/* =========================================================
   Tir en Campagne - Style unifié admin + public
   ========================================================= */

:root{
  --tc-bg: #f4f7fb;
  --tc-surface: #ffffff;
  --tc-surface-soft: #f8fafc;
  --tc-border: #dbe4ee;
  --tc-border-strong: #c7d3e0;

  --tc-text: #0f172a;
  --tc-text-soft: #475569;
  --tc-text-muted: #64748b;

  --tc-primary: #1d4ed8;
  --tc-primary-hover: #1e40af;
  --tc-primary-soft: #dbeafe;

  --tc-success: #15803d;
  --tc-success-bg: #dcfce7;
  --tc-success-border: #86efac;

  --tc-warning: #b45309;
  --tc-warning-bg: #fef3c7;
  --tc-warning-border: #fcd34d;

  --tc-danger: #b91c1c;
  --tc-danger-hover: #991b1b;
  --tc-danger-bg: #fee2e2;
  --tc-danger-border: #fecaca;

  --tc-info: #0369a1;
  --tc-info-bg: #e0f2fe;
  --tc-info-border: #bae6fd;

  --tc-radius-sm: 8px;
  --tc-radius: 14px;
  --tc-radius-lg: 20px;

  --tc-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --tc-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --tc-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

  --tc-gap: 18px;
  --tc-gap-lg: 24px;

  --tc-input-h: 46px;
  --tc-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================================================
   Base
   ========================================================= */

html{
  scroll-behavior: smooth;
}

body{
  font-family: var(--tc-font);
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(29, 78, 216, 0.06), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(3, 105, 161, 0.05), transparent 50%),
    var(--tc-bg);
  color: var(--tc-text);
}

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

.wrap,
.tc-wrap,
.tc-form-container{
  max-width: 1280px;
  margin: 0 auto;
}

.wrap{
  padding: 20px;
}

.tc-wrap{
  padding: 20px;
}

h1, h2, h3, h4{
  color: var(--tc-text);
  margin: 0 0 14px;
  line-height: 1.2;
}

.wrap h1,
.wrap h2,
.wrap h3,
.tc-title,
.tc-form-title{
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wrap h1{
  font-size: clamp(1.6rem, 2vw, 2.15rem);
  margin-bottom: 20px;
}

.wrap h2,
.tc-title{
  font-size: clamp(1.35rem, 1.8vw, 1.85rem);
  margin-bottom: 18px;
}

.wrap h3,
.tc-form-title{
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
}

p{
  color: var(--tc-text-soft);
  line-height: 1.55;
}

small,
.description{
  color: var(--tc-text-muted);
  line-height: 1.45;
}

/* =========================================================
   Cards / sections
   ========================================================= */

.tc-card,
.tc-panel,
.tc-box,
.wrap .postbox,
.tc-form-container .tc-card{
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
}

.tc-card,
.tc-panel,
.tc-box{
  padding: 22px;
}

.tc-section{
  margin-bottom: 24px;
}

/* =========================================================
   Notices
   ========================================================= */

.notice,
.updated,
.error,
.tc-notice{
  border-radius: 12px !important;
  border: 1px solid var(--tc-border) !important;
  box-shadow: var(--tc-shadow-sm);
  padding: 14px 16px !important;
  margin: 0 0 18px !important;
  background: #fff;
}

.notice p,
.updated p,
.error p,
.tc-notice{
  margin: 0;
  font-size: 14px;
}

.notice-success,
.updated,
.tc-success{
  background: var(--tc-success-bg) !important;
  color: var(--tc-success) !important;
  border-color: var(--tc-success-border) !important;
}

.notice-error,
.error,
.tc-error{
  background: var(--tc-danger-bg) !important;
  color: var(--tc-danger) !important;
  border-color: var(--tc-danger-border) !important;
}

.tc-warning{
  background: var(--tc-warning-bg);
  color: var(--tc-warning);
  border: 1px solid var(--tc-warning-border);
}

/* =========================================================
   Boutons
   ========================================================= */

.button,
.button-primary,
.button-secondary,
.tc-btn{
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 42px;
  margin-top: 4px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  line-height: 1.2;
  cursor: pointer;
  transition: .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
}

.button:hover,
.button-primary:hover,
.button-secondary:hover,
.tc-btn:hover{
  transform: translateY(-1px);
}

.button:focus,
.button-primary:focus,
.button-secondary:focus,
.tc-btn:focus,
input:focus,
select:focus,
textarea:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14) !important;
}

.button,
.button-secondary,
.tc-btn-secondary{
  background: #fff !important;
  color: var(--tc-text) !important;
  border-color: var(--tc-border-strong) !important;
}

.button:hover,
.button-secondary:hover,
.tc-btn-secondary:hover{
  background: #f8fafc !important;
  border-color: #b6c5d6 !important;
}

.button-primary,
.tc-btn-primary{
  background: var(--tc-primary) !important;
  color: #fff !important;
  border-color: var(--tc-primary) !important;
}

.button-primary:hover,
.tc-btn-primary:hover{
  background: var(--tc-primary-hover) !important;
  border-color: var(--tc-primary-hover) !important;
}

.tc-btn-danger,
.button.delete-button{
  background: var(--tc-danger) !important;
  color: #fff !important;
  border-color: var(--tc-danger) !important;
}

.tc-btn-danger:hover,
.button.delete-button:hover{
  background: var(--tc-danger-hover) !important;
  border-color: var(--tc-danger-hover) !important;
}

.tc-btn-sm{
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.tc-disabled{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* =========================================================
   Formulaires
   ========================================================= */

form{
  margin: 0;
}

label{
  display: inline-block;
  font-weight: 700;
  color: var(--tc-text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea,
.tc-input,
.tc-select{
  width: 100%;
  min-height: var(--tc-input-h);
  padding: 10px 14px;
  border: 1px solid var(--tc-border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--tc-text);
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:hover,
select:hover,
textarea:hover{
  border-color: #a8b8ca;
}

textarea{
  min-height: 120px;
  resize: vertical;
}

.form-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  overflow: hidden;
  box-shadow: var(--tc-shadow);
}

.form-table th,
.form-table td{
  padding: 16px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #edf2f7;
}

.form-table tr:last-child th,
.form-table tr:last-child td{
  border-bottom: none;
}

.form-table th{
  width: 240px;
  background: #f8fafc;
  color: var(--tc-text);
  font-weight: 700;
}

.tc-form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  margin-bottom: 20px;
}

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

.tc-form-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* =========================================================
   Filtres / barres d’actions
   ========================================================= */

.tc-actions-bar,
.tc-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin: 18px 0 22px;
  padding: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow-sm);
}

.tc-filter-item{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
}

#searchInput,
#societeFilter,
#tc-search,
#tc-filter-societe{
  max-width: none;
  margin-bottom: 0;
}

/* =========================================================
   Tableaux
   ========================================================= */

.tc-table-wrapper,
.tc-table-responsive{
  width: 100%;
  overflow-x: auto;
  border-radius: var(--tc-radius);
  box-shadow: var(--tc-shadow);
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
}

table.widefat,
.tc-table,
#resultatsTable,
#statsTable{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  min-width: 760px;
}

table.widefat thead,
.tc-table thead,
#resultatsTable thead,
#statsTable thead{
  background: linear-gradient(180deg, #f8fafc 0%, #eef4f9 100%);
}

table.widefat th,
table.widefat td,
.tc-table th,
.tc-table td,
#resultatsTable th,
#resultatsTable td,
#statsTable th,
#statsTable td{
  padding: 14px 16px;
  border-bottom: 1px solid #ebf0f5;
  vertical-align: middle;
  white-space: nowrap;
}

table.widefat th,
.tc-table th,
#resultatsTable th,
#statsTable th{
  color: var(--tc-text) !important;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

table.widefat tbody tr,
.tc-table tbody tr,
#resultatsTable tbody tr,
#statsTable tbody tr{
  transition: background .18s ease, transform .18s ease;
}

table.widefat tbody tr:nth-child(even),
.tc-table tbody tr:nth-child(even),
#resultatsTable tbody tr:nth-child(even),
#statsTable tbody tr:nth-child(even){
  background: #fbfdff;
}

table.widefat tbody tr:hover,
.tc-table tbody tr:hover,
#resultatsTable tbody tr:hover,
#statsTable tbody tr:hover{
  background: #f3f8ff;
}

.tc-empty{
  text-align: center;
  color: var(--tc-text-muted);
  font-style: italic;
  padding: 28px !important;
}

/* =========================================================
   Badges / états
   ========================================================= */

.tc-badge{
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--tc-info-bg);
  color: var(--tc-info);
  border: 1px solid var(--tc-info-border);
}

.tc-badge-success{
  background: var(--tc-success-bg);
  color: var(--tc-success);
  border: 1px solid var(--tc-success-border);
}

.tc-badge-warning{
  background: var(--tc-warning-bg);
  color: var(--tc-warning);
  border: 1px solid var(--tc-warning-border);
}

.tc-badge-danger{
  background: var(--tc-danger-bg);
  color: var(--tc-danger);
  border: 1px solid var(--tc-danger-border);
}

.tc-actions{
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-footer{
  margin-top: 16px;
  color: var(--tc-text-muted);
  font-size: 13px;
  text-align: right;
}

/* =========================================================
   Gestion des personnes (public)
   ========================================================= */

.tc-people-page{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tc-people-hero{
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 240px at 0% 0%, rgba(29, 78, 216, 0.13), transparent 65%),
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(240,247,255,0.96) 100%);
}

.tc-people-hero::after{
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(3, 105, 161, 0.16) 0%, rgba(3, 105, 161, 0) 70%);
  pointer-events: none;
}

.tc-people-hero-head{
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.tc-people-hero-copy{
  max-width: 760px;
}

.tc-people-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.16);
  background: rgba(255,255,255,0.72);
  color: var(--tc-primary-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tc-people-lead{
  max-width: 680px;
  margin: 0;
  color: var(--tc-text-soft);
}

.tc-people-actions{
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.tc-people-stats{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.tc-people-stat{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(199, 211, 224, 0.85);
  background: rgba(255,255,255,0.8);
  box-shadow: var(--tc-shadow-sm);
}

.tc-people-stat-value{
  color: var(--tc-text);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1;
}

.tc-people-stat-label{
  color: var(--tc-text-muted);
  font-size: 13px;
  font-weight: 700;
}

.tc-people-filters{
  margin-top: 0;
}

.tc-col-actions{
  min-width: 158px;
}

.tc-people-page .tc-table{
  min-width: 0;
  table-layout: auto;
}

.tc-people-page .tc-table th,
.tc-people-page .tc-table td{
  padding: 10px 8px;
  font-size: 17px;
  white-space: normal;
  line-height: 1.3;
}

.tc-people-page .tc-table th{
  font-size: 11px;
}

.tc-people-page .tc-col-name,
.tc-people-page .tc-col-firstname,
.tc-people-page .tc-col-category,
.tc-people-page .tc-col-weapon,
.tc-people-page .tc-col-gender,
.tc-people-page .tc-col-status{
  width: 1%;
}

.tc-people-page .tc-col-societe{
  max-width: 120px;
  font-size: 11px;
  line-height: 1.25;
}

.tc-people-page .tc-col-actions{
  width: 1%;
  min-width: 132px;
  white-space: nowrap;
}

.tc-people-page .tc-col-actions .tc-btn,
.tc-people-page .tc-col-actions .tc-disabled{
  min-height: 28px;
  min-width: 28px;
  padding: 4px 6px;
  border-radius: 8px;
}

.tc-people-page .tc-col-actions .dashicons{
  width: 14px;
  height: 14px;
  font-size: 14px;
}

.tc-btn-label{
  min-width: 38px;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.tc-btn-label-text{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .04em;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tc-people-page .tc-badge{
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}

.tc-row-archived{
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.06) 0%, rgba(255,255,255,0.92) 100%) !important;
}

.tc-row-archived:hover{
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, rgba(243, 248, 255, 1) 100%) !important;
}

.tc-row-archived td{
  color: var(--tc-text-soft);
}

/* =========================================================
   Select2 harmonisation
   ========================================================= */

.select2-container{
  width: 100% !important;
}

.select2-container .select2-selection--single{
  min-height: var(--tc-input-h);
  border-radius: 12px !important;
  border: 1px solid var(--tc-border-strong) !important;
  display: flex !important;
  align-items: center;
  background: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered{
  line-height: normal !important;
  padding-left: 14px !important;
  color: var(--tc-text) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow{
  height: 100% !important;
  right: 10px !important;
}

/* =========================================================
   Page saisie résultats
   ========================================================= */

.tc-form-container{
  max-width: 860px;
  padding: 20px;
}

.tc-form-title{
  text-align: center;
  margin-bottom: 20px;
}

.tc-points-input{
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: .03em;
}

.tc-message-success{
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tc-success-bg);
  color: var(--tc-success);
  border: 1px solid var(--tc-success-border);
  font-weight: 700;
}

.tc-message-error{
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tc-danger-bg);
  color: var(--tc-danger);
  border: 1px solid var(--tc-danger-border);
  font-weight: 700;
}

.tc-mention{
  margin-top: 10px;
  font-weight: 800;
  font-size: 14px;
}

.tc-mannequins{
  margin-top: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed var(--tc-border-strong);
  border-radius: 12px;
}

.tc-tireur-row{
  display: flex;
  gap: 10px;
  align-items: center;
}

#scan_qr_btn{
  width: auto !important;
  min-width: 48px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--tc-border-strong);
  background: #fff;
  font-size: 20px;
}

#qr_reader_modal{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(4px);
  z-index: 99999;
}

#qr_reader_box{
  background: #fff;
  max-width: 460px;
  margin: 6% auto;
  padding: 16px;
  border-radius: 18px;
  box-shadow: var(--tc-shadow-lg);
}

/* =========================================================
   Impression mention
   ========================================================= */

#tc_print_mention_btn{
  display: none;
  margin-top: 12px;
}

#tc-mention-print{
  display: none;
  width: 105mm;
  height: 148mm;
  position: relative;
  font-family: Arial, sans-serif;
  font-size: 12pt;
  border: 1px solid #000;
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
}

#tc-mention-print .field{
  position: absolute;
}

#m_distance   { top: 40mm; left: 20mm; }
#m_resultat   { top: 40mm; left: 55mm; }
#m_annee_naiss{ top: 40mm; left: 85mm; }
#m_nom_prenom { top: 60mm; left: 15mm; }
#m_logo       { top: 75mm; left: 20mm; max-width: 30mm; height: auto; }
#m_annee      { top: 75mm; left: 85mm; }

@media print {
  html,
  body{
    width: 105mm;
    height: 148mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  body * {
    visibility: hidden;
  }

  #tc-mention-print,
  #tc-mention-print * {
    visibility: visible;
  }

  #tc-mention-print{
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
  }

  @page{
    size: A6 portrait;
    margin: 0;
  }
}

/* =========================================================
   Utilitaires
   ========================================================= */

.text-center{ text-align: center !important; }
.text-right{ text-align: right !important; }
.text-left{ text-align: left !important; }
.mt-0{ margin-top: 0 !important; }
.mb-0{ margin-bottom: 0 !important; }
.mb-1{ margin-bottom: 10px !important; }
.mb-2{ margin-bottom: 16px !important; }
.mb-3{ margin-bottom: 24px !important; }

/* =========================================================
   Responsive
   ========================================================= */

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

  .form-table th{
    width: 200px;
  }
}

@media (max-width: 768px){
  .wrap,
  .tc-wrap,
  .tc-form-container{
    padding: 12px;
  }

  .tc-actions-bar,
  .tc-filters{
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .tc-filter-item{
    min-width: 100%;
  }

  .tc-form-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button-primary,
  .button-secondary,
  .tc-btn{
    width: 100%;
  }

  .form-table,
  .form-table tbody,
  .form-table tr,
  .form-table td,
  .form-table th{
    display: block;
    width: 100%;
  }

  .form-table{
    overflow: hidden;
  }

  .form-table th{
    border-bottom: none;
    padding-bottom: 6px;
    background: #fff;
  }

  .form-table td{
    padding-top: 0;
  }

  .tc-table-wrapper,
  .tc-table-responsive{
    border-radius: 14px;
  }

  #resultatsTable,
  #statsTable,
  .tc-table,
  table.widefat{
    min-width: 700px;
  }
}

@media (max-width: 520px){
  h1{ font-size: 1.45rem; }
  h2{ font-size: 1.25rem; }
  h3{ font-size: 1.05rem; }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  input[type="file"],
  select,
  textarea{
    font-size: 16px;
  }
}
/* =========================================================
   Responsive renforcé - Tablette + Smartphone
   ========================================================= */

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
  .wrap,
  .tc-wrap,
  .tc-form-container {
    padding: 16px;
  }

  .tc-card,
  .tc-panel,
  .tc-box {
    padding: 18px;
  }

  .tc-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
  }

  .tc-filters,
  .tc-actions-bar {
    gap: 12px;
    padding: 14px;
  }

  .tc-filter-item {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }

  .form-table th,
  .form-table td,
  .tc-table th,
  .tc-table td,
  table.widefat th,
  table.widefat td,
  #resultatsTable th,
  #resultatsTable td,
  #statsTable th,
  #statsTable td {
    padding: 12px 12px;
  }

  .tc-form-title,
  .tc-title,
  .wrap h2 {
    text-align: center;
  }

  .tc-people-hero-head {
    flex-direction: column;
  }

  .tc-people-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #qr_reader_box {
    max-width: 92vw;
    margin: 8vh auto;
  }
}


/* ---------- Smartphone large / petite tablette ---------- */
@media (max-width: 768px) {
  .wrap,
  .tc-wrap,
  .tc-form-container {
    padding: 12px;
  }

  .tc-card,
  .tc-panel,
  .tc-box {
    padding: 14px;
    border-radius: 14px;
  }

  .tc-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tc-filters,
  .tc-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .tc-filter-item {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .tc-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-form-actions .button,
  .tc-form-actions .button-primary,
  .tc-form-actions .button-secondary,
  .tc-form-actions .tc-btn,
  .tc-form-actions input[type="submit"],
  .tc-form-actions a {
    width: 100%;
  }

  .button,
  .button-primary,
  .button-secondary,
  .tc-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }

  .tc-tireur-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-people-stats {
    grid-template-columns: 1fr;
  }

  .tc-people-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-people-page .tc-table th,
  .tc-people-page .tc-table td {
    padding: 9px 7px;
    font-size: 11px;
  }

  .tc-people-page .tc-col-societe {
    max-width: 96px;
    font-size: 10px;
  }

  .tc-people-actions .tc-btn {
    width: 100%;
  }

  .tc-tireur-row select,
  .tc-tireur-row .select2-container {
    width: 100% !important;
  }

  #scan_qr_btn {
    width: 100% !important;
    min-height: 46px;
    justify-content: center;
    font-size: 18px;
  }

  .form-table,
  .form-table tbody,
  .form-table tr,
  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
  }

  .form-table {
    border-radius: 14px;
    overflow: hidden;
  }

  .form-table tr {
    display: block;
    padding: 0;
    border-bottom: 1px solid #edf2f7;
  }

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

  .form-table th {
    width: 100%;
    padding: 14px 14px 6px;
    background: transparent;
    border: none;
  }

  .form-table td {
    padding: 0 14px 14px;
    border: none;
  }

  .tc-table-wrapper,
  .tc-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tc-table,
  table.widefat,
  #resultatsTable,
  #statsTable {
    min-width: 680px;
  }

  .tc-footer {
    text-align: left;
  }

  #qr_reader_box {
    width: calc(100vw - 24px);
    max-width: none;
    margin: 5vh auto;
    padding: 12px;
    border-radius: 14px;
  }

  #close_qr {
    width: 100%;
  }
}


/* ---------- Petit smartphone ---------- */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .wrap,
  .tc-wrap,
  .tc-form-container {
    padding: 10px;
  }

  .tc-card,
  .tc-panel,
  .tc-box {
    padding: 12px;
    border-radius: 12px;
  }

  .wrap h1,
  .tc-title {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .wrap h2,
  .tc-form-title {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .wrap h3 {
    font-size: 1.05rem;
  }

  label {
    font-size: 14px;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  input[type="file"],
  select,
  textarea,
  .tc-input,
  .tc-select {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px; /* évite le zoom iPhone */
    border-radius: 10px;
  }

  textarea {
    min-height: 100px;
  }

  .button,
  .button-primary,
  .button-secondary,
  .tc-btn {
    min-height: 44px;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
  }

  .tc-btn-sm {
    min-height: 40px;
    padding: 8px 10px;
  }

  .tc-notice,
  .notice,
  .updated,
  .error {
    padding: 12px !important;
    font-size: 13px;
  }

  .tc-points-input {
    font-size: 1.05rem;
    text-align: center;
  }

  .tc-mention {
    font-size: 13px;
    line-height: 1.4;
  }

  .tc-mannequins {
    padding: 12px;
  }

  .tc-badge,
  .tc-badge-success,
  .tc-badge-warning,
  .tc-badge-danger {
    font-size: 11px;
    line-height: 1.3;
    padding: 5px 8px;
    white-space: normal;
    text-align: center;
  }

  .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  .tc-actions {
    gap: 6px;
    flex-wrap: wrap;
  }

  .tc-table,
  table.widefat,
  #resultatsTable,
  #statsTable {
    min-width: 620px;
  }

  #qr_reader_box {
    width: calc(100vw - 16px);
    margin: 3vh auto;
    padding: 10px;
  }
}


/* ---------- Très petit écran ---------- */
@media (max-width: 360px) {
  .wrap,
  .tc-wrap,
  .tc-form-container {
    padding: 8px;
  }

  .tc-card,
  .tc-panel,
  .tc-box {
    padding: 10px;
  }

  .wrap h1,
  .tc-title {
    font-size: 1.2rem;
  }

  .wrap h2,
  .tc-form-title {
    font-size: 1.08rem;
  }

  .button,
  .button-primary,
  .button-secondary,
  .tc-btn,
  #scan_qr_btn {
    font-size: 13px;
    padding: 9px 10px;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  input[type="file"],
  select,
  textarea {
    padding: 9px 10px;
  }

  .tc-table,
  table.widefat,
  #resultatsTable,
  #statsTable {
    min-width: 580px;
  }
}
/* =========================================================
   Tables -> Cards sur smartphone
   ========================================================= */

@media (max-width: 768px){

  .tc-table,
  table.widefat,
  #resultatsTable,
  #statsTable{
    border:0;
    min-width:0;
  }

  .tc-table thead,
  table.widefat thead,
  #resultatsTable thead,
  #statsTable thead{
    display:none;
  }

  .tc-table tr,
  table.widefat tr,
  #resultatsTable tr,
  #statsTable tr{
    display:block;
    margin-bottom:14px;
    background:#fff;
    border-radius:14px;
    box-shadow:0 6px 16px rgba(0,0,0,0.08);
    border:1px solid #e2e8f0;
    padding:10px 14px;
  }

  .tc-table td,
  table.widefat td,
  #resultatsTable td,
  #statsTable td{
    display:flex;
    justify-content:space-between;
    align-items:center;
    border:none;
    padding:8px 0;
    font-size:14px;
  }

  .tc-table td::before,
  table.widefat td::before,
  #resultatsTable td::before,
  #statsTable td::before{
    content:attr(data-label);
    font-weight:700;
    color:#475569;
    margin-right:12px;
    flex:0 0 45%;
  }

  .tc-table td:last-child,
  table.widefat td:last-child{
    padding-bottom:0;
  }

}
@media (max-width:768px){

  .tc-actions{
    justify-content:flex-end;
    gap:6px;
  }

  .tc-table td{
    border-bottom:1px dashed #e2e8f0;
  }

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

}

.tc-password-card{
  max-width: 700px;
  margin: 24px auto;
}

.tc-password-field{
  position: relative;
}

.tc-password-field input{
  padding-right: 48px;
}

.tc-password-toggle{
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-text-soft);
}

.tc-password-toggle:hover{
  background: var(--tc-surface-soft);
  color: var(--tc-text);
}

.tc-password-toggle:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

@media (max-width: 768px){
  .tc-password-card{
    margin: 16px auto;
  }
}
