/* ================================================================
   JuData v6 — Feuille de style globale
   Palette :
     Ivory        #FFFFF0
     Sage         #D3C69D
     Ecru         #C9B36F
     Coyote       #756A48
     Battleship   #85847D
     Jet          #2C2B26
   Polices : Cormorant Garamond (display) + Jost (corps)
   AUCUN emoji ni forme decorative SVG
================================================================ */

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

/* ---- Variables globales ---- */
:root {
  --ivory:   #FFFFF0;
  --sage:    #D3C69D;
  --ecru:    #C9B36F;
  --coyote:  #756A48;
  --gray:    #85847D;
  --jet:     #2C2B26;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', 'Helvetica Neue', Arial, sans-serif;

  --radius:    4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 6px rgba(44,43,38,.09);
  --shadow:    0 3px 16px rgba(44,43,38,.13);
  --shadow-lg: 0 10px 48px rgba(44,43,38,.20);
  --tr:        220ms ease;
  --sidebar-w: 230px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html   { font-size: 16px; scroll-behavior: smooth; }
body   { font-family: var(--font-body); font-weight: 400; color: var(--jet);
         background: var(--ivory); line-height: 1.65;
         -webkit-font-smoothing: antialiased; }
img    { max-width: 100%; display: block; }
a      { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---- Typographie ---- */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 500;
                     line-height: 1.2; color: var(--jet); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.2rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ================================================================
   BOUTONS
================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .7rem 1.75rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .82rem; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--tr), color var(--tr), border-color var(--tr),
              box-shadow var(--tr), transform var(--tr);
}
.btn:active   { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--ecru);  color: var(--jet);   border-color: var(--ecru); }
.btn-primary:hover { background: var(--coyote); border-color: var(--coyote);
                     color: var(--ivory); box-shadow: var(--shadow); }

.btn-secondary { background: transparent; color: var(--jet); border-color: var(--coyote); }
.btn-secondary:hover { background: var(--jet); border-color: var(--jet); color: var(--ivory); }

.btn-dark  { background: var(--jet); color: var(--ivory); border-color: var(--jet); }
.btn-dark:hover { background: var(--coyote); border-color: var(--coyote); }

.btn-outline-light { background: transparent; color: var(--ivory);
                     border-color: rgba(255,255,240,.4); }
.btn-outline-light:hover { background: rgba(255,255,240,.1); border-color: var(--ivory); }

.btn-danger { background: #b03a2e; color: #fff; border-color: #b03a2e; }
.btn-danger:hover { background: #922b21; border-color: #922b21; }

.btn-sm   { padding: .45rem 1rem; font-size: .76rem; }
.btn-lg   { padding: .95rem 2.5rem; font-size: .88rem; }
.btn-full { width: 100%; }

/* ================================================================
   FORMULAIRES
================================================================ */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block; font-size: .78rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--coyote); margin-bottom: .4rem;
}

.form-control {
  width: 100%; padding: .7rem 1rem;
  border: 1.5px solid var(--sage); border-radius: var(--radius);
  background: #fff; color: var(--jet); outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.form-control:focus {
  border-color: var(--ecru);
  box-shadow: 0 0 0 3px rgba(201,179,111,.18);
}
.form-control::placeholder { color: var(--gray); opacity: .65; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2385847D' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { font-size: .78rem; color: #b03a2e; margin-top: .3rem; }
.form-hint  { font-size: .78rem; color: var(--gray); margin-top: .3rem; }

/* ================================================================
   CARTES
================================================================ */
.card {
  background: #fff; border: 1px solid rgba(44,43,38,.09);
  border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--tr), transform var(--tr);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid rgba(44,43,38,.08);
}
.card-title { font-family: var(--font-display); font-size: 1.2rem;
              font-weight: 600; color: var(--jet); }

/* ================================================================
   BADGES
================================================================ */
.badge {
  display: inline-block; padding: .22rem .7rem; border-radius: 3px;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; line-height: 1.4;
}
.badge-competition { background: var(--jet);    color: var(--ivory); }
.badge-cours       { background: var(--ecru);   color: var(--jet);   }
.badge-stage       { background: var(--coyote); color: var(--ivory); }
.badge-evenement   { background: var(--gray);   color: var(--ivory); }
.badge-success { background: #1e8449; color: #fff; }
.badge-error   { background: #b03a2e; color: #fff; }
.badge-neutral { background: var(--sage); color: var(--jet); }

/* ================================================================
   MODAL
================================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(44,43,38,.6); backdrop-filter: blur(4px);
  z-index: 900; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--ivory); border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem; width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
  animation: modalIn .26s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute; top: 1.1rem; right: 1.25rem;
  background: none; border: none; font-size: 1.6rem;
  line-height: 1; cursor: pointer; color: var(--gray);
  transition: color var(--tr); padding: 0;
}
.modal-close:hover { color: var(--jet); }
.modal-title    { font-family: var(--font-display); font-size: 1.55rem;
                  margin-bottom: .4rem; color: var(--jet); }
.modal-subtitle { font-size: .88rem; color: var(--gray); margin-bottom: 1.6rem; }

/* ================================================================
   TOAST
================================================================ */
.toast-container {
  position: fixed; bottom: 1.75rem; right: 1.75rem;
  z-index: 1100; display: flex; flex-direction: column; gap: .6rem;
}
.toast {
  padding: .85rem 1.4rem; border-radius: var(--radius);
  font-size: .86rem; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .26s ease; min-width: 240px; max-width: 380px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-success { background: #1e8449; color: #fff; }
.toast-error   { background: #b03a2e; color: #fff; }
.toast-info    { background: var(--jet); color: var(--ivory); }
.toast-warning { background: #9a7d0a; color: #fff; }

/* ================================================================
   TABLEAUX
================================================================ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  background: var(--jet); color: var(--ivory);
  padding: .75rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
thead th:first-child { border-radius: 4px 0 0 0; }
thead th:last-child  { border-radius: 0 4px 0 0; }
tbody tr { border-bottom: 1px solid rgba(44,43,38,.07); transition: background var(--tr); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(201,179,111,.07); }
tbody td { padding: .8rem 1rem; vertical-align: middle; }
tfoot td { padding: .75rem 1rem; font-size: .82rem; color: var(--gray);
           border-top: 2px solid rgba(44,43,38,.1); }

/* ================================================================
   LAYOUT INTERNE (pages app)
================================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--jet); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; z-index: 200; flex-shrink: 0;
}
.sidebar-brand {
  padding: 1.4rem 1.25rem 1.1rem;
  display: flex; align-items: center; gap: .8rem;
  border-bottom: 1px solid rgba(255,255,240,.07);
}
.sidebar-brand img { width: 34px; height: 34px; object-fit: contain; }
.sidebar-brand-name {
  font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 600; color: var(--ecru); letter-spacing: .05em;
}
.sidebar-nav { flex: 1; padding: .85rem 0; }
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.25rem; color: var(--sage);
  font-size: .84rem; font-weight: 400; letter-spacing: .03em;
  cursor: pointer; text-decoration: none; width: 100%;
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; transition: background var(--tr), color var(--tr);
}
.nav-item:hover  { background: rgba(255,255,240,.05); color: var(--ivory); }
.nav-item.active { background: rgba(201,179,111,.11); color: var(--ecru);
                   border-left-color: var(--ecru); font-weight: 500; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,240,.07); }
.btn-logout {
  width: 100%; background: transparent; border: 1px solid rgba(176,58,46,.4);
  color: #e07060; padding: .6rem 1rem; border-radius: var(--radius);
  font-size: .8rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
}
.btn-logout:hover { background: rgba(176,58,46,.2); border-color: rgba(176,58,46,.7); }

/* Header app */
.app-header {
  background: var(--ivory); border-bottom: 1px solid rgba(44,43,38,.1);
  padding: .8rem 1.75rem; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
  min-height: 60px;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-user { display: flex; align-items: center; gap: .85rem; }
.header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--ecru); flex-shrink: 0;
}
.header-name { font-weight: 600; font-size: .9rem; color: var(--jet); line-height: 1.2; }
.header-role { font-size: .73rem; color: var(--gray); letter-spacing: .04em; }

/* Contenu principal */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-content { flex: 1; padding: 2rem; }
.page-header  { margin-bottom: 2rem; }
.page-title   { font-family: var(--font-display); font-size: 1.9rem;
                color: var(--jet); margin-bottom: .2rem; }
.page-subtitle { font-size: .88rem; color: var(--gray); }

/* Footer app */
.app-footer {
  background: var(--jet); color: var(--gray);
  text-align: center; padding: .8rem 1rem;
  font-size: .76rem; letter-spacing: .06em;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px;
             cursor: pointer; padding: .4rem; background: none; border: none; }
.hamburger span { display: block; width: 22px; height: 2px;
                  background: var(--jet); border-radius: 2px; transition: var(--tr); }

/* ================================================================
   STATS / GRILLES
================================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
              gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid rgba(44,43,38,.08);
             border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
             text-align: center; box-shadow: var(--shadow-sm); }
.stat-value { font-family: var(--font-display); font-size: 2.1rem;
              font-weight: 600; color: var(--ecru); line-height: 1; margin-bottom: .3rem; }
.stat-label { font-size: .75rem; color: var(--gray);
              letter-spacing: .06em; text-transform: uppercase; }

/* ================================================================
   CEINTURES
================================================================ */
.belt-badge { display: inline-block; padding: .2rem .65rem; border-radius: 3px;
              font-size: .72rem; font-weight: 600; white-space: nowrap; }
.belt-blanche       { background:#f0f0f0; color:#333; border:1px solid #ccc; }
.belt-blanche-jaune { background:linear-gradient(90deg,#f0f0f0 50%,#e8c800 50%); color:#333; }
.belt-jaune         { background:#e8c800; color:#333; }
.belt-jaune-orange  { background:linear-gradient(90deg,#e8c800 50%,#e07820 50%); color:#333; }
.belt-orange        { background:#e07820; color:#fff; }
.belt-orange-verte  { background:linear-gradient(90deg,#e07820 50%,#2e7d32 50%); color:#fff; }
.belt-verte         { background:#2e7d32; color:#fff; }
.belt-verte-bleue   { background:linear-gradient(90deg,#2e7d32 50%,#1565c0 50%); color:#fff; }
.belt-bleue         { background:#1565c0; color:#fff; }
.belt-marron        { background:#6d4c41; color:#fff; }
.belt-noire         { background:#1a1a1a; color:var(--ecru); }

/* Résultats */
.result-victoire { background:#1e8449; color:#fff; }
.result-defaite  { background:#b03a2e; color:#fff; }

/* ================================================================
   UTILITAIRES
================================================================ */
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-muted     { color: var(--gray); font-size: .88rem; }
.text-ecru      { color: var(--ecru); }
.text-coyote    { color: var(--coyote); }
.text-danger    { color: #b03a2e; }
.text-success   { color: #1e8449; }
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap      { flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1{margin-top:.5rem} .mt-2{margin-top:1rem} .mt-3{margin-top:1.5rem} .mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem} .mb-2{margin-bottom:1rem} .mb-3{margin-bottom:1.5rem} .mb-4{margin-bottom:2rem}
.hidden { display: none !important; }
.w-100  { width: 100%; }
.divider { border: none; border-top: 1px solid rgba(44,43,38,.1); margin: 1.5rem 0; }
.section-label { font-size:.76rem; font-weight:600; letter-spacing:.12em;
                 text-transform:uppercase; color:var(--coyote); margin-bottom:.6rem; display:block; }
.loader { display:inline-block; width:18px; height:18px;
          border:2px solid rgba(255,255,255,.3); border-top-color:#fff;
          border-radius:50%; animation:spin .65s linear infinite; }
.loader-dark { border-color:rgba(44,43,38,.15); border-top-color:var(--jet); }
@keyframes spin { to { transform:rotate(360deg); } }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 960px) {
  .sidebar { position:fixed; left:calc(-1 * var(--sidebar-w));
             transition:left .3s ease; box-shadow:none; }
  .sidebar.open { left:0; box-shadow:var(--shadow-lg); }
  .hamburger { display:flex; }
  .page-content { padding:1.25rem 1rem; }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns:1fr; }
  .modal { padding:1.5rem 1.25rem; }
  .stats-grid { grid-template-columns:1fr 1fr; }
}
