/* ═══════════════════════════════════════════════════════════════
   PLANNING ENTRAÎNEUR SESCB — STYLES MOBILE-FIRST
   Charte: Vert #96c93d + Orange #df6436 + Blanc — APLATS PURS
   ═══════════════════════════════════════════════════════════════ */

:root {
  --green:        #96c93d;
  --green-dark:   #7BA82F;
  --green-darker: #5F8A1F;
  --green-soft:   #F0F7E4;
  --orange:       #df6436;
  --orange-dark:  #C4501F;
  --orange-soft:  #FBE8DF;
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-500: #64748B;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --red:      #EF4444;
  --radius:    12px;
  --radius-sm: 8px;
  --header-h:  52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100); color: var(--gray-800);
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom, 0);
}
.hidden { display: none !important; }

/* HEADER — APLAT VERT */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--green); color: #fff;
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-icon { font-size: 20px; }
.app-header h1 { font-size: 16px; font-weight: 700; line-height: 1.2; }
.app-header p { font-size: 10px; opacity: .85; line-height: 1.2; }
.header-btn {
  width: 40px; height: 40px; border: none; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.2); color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s, transform .1s;
}
.header-btn:active { transform: scale(.9); background: rgba(255,255,255,.3); }

/* BARRE SEMAINE */
.week-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.nav-btn {
  width: 44px; height: 44px; min-width: 44px; border: none;
  border-radius: var(--radius-sm); background: var(--gray-100);
  font-size: 20px; color: var(--gray-700); cursor: pointer;
  transition: background .2s, transform .1s;
}
.nav-btn:active { transform: scale(.9); background: var(--green-soft); color: var(--green-darker); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.week-info { flex: 1; text-align: center; }
.week-num { font-size: 11px; color: var(--gray-500); font-weight: 500; }
.week-dates { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.week-bar-bottom {
  position: sticky; top: calc(var(--header-h) + 60px); z-index: 29;
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 4px 12px 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.today-btn {
  padding: 6px 12px; border: none; border-radius: 6px;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.today-btn:active { background: var(--green-dark); }
.dup-btn {
  padding: 6px 12px; border: none; border-radius: 6px;
  background: var(--orange); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .2s, transform .1s;
}
.dup-btn:active { transform: scale(.95); background: var(--orange-dark); }
.week-select {
  flex: 1; border: 1px solid var(--gray-200); border-radius: 6px;
  padding: 6px 8px; font-size: 12px; color: var(--gray-500);
  background: var(--gray-50); cursor: pointer;
}

/* TOGGLE VUE */
.view-toggle-wrap { padding: 12px 12px 0; }
.view-toggle { display: flex; background: var(--gray-200); border-radius: var(--radius-sm); padding: 2px; }
.view-toggle button {
  flex: 1; padding: 10px; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--gray-500); transition: all .2s;
}
.view-toggle button.active { background: #fff; color: var(--green-darker); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ONGLETS JOURS */
.day-tabs { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  display: flex; flex-direction: column; align-items: center;
  min-width: 54px; padding: 8px 10px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); background: #fff; font-size: 13px;
  font-weight: 500; color: var(--gray-700); cursor: pointer; white-space: nowrap; transition: all .2s;
}
.day-tab.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 6px rgba(150,201,61,.4); }
.day-count { font-size: 10px; opacity: .65; margin-top: 2px; }

/* LÉGENDE */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gray-500); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* GRILLE */
.planning-grid { padding: 8px 12px 100px; display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width:640px)  { .planning-grid.week-view { grid-template-columns: repeat(2,1fr); } }
@media (min-width:1024px) { .planning-grid.week-view { grid-template-columns: repeat(3,1fr); } }
@media (min-width:1280px) { .planning-grid.week-view { grid-template-columns: repeat(6,1fr); } }

/* COLONNE JOUR */
.day-column { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; }
.day-col-header { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); }
.day-col-header.holiday { background: var(--orange-soft); }
.day-col-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.day-col-date { font-size: 12px; color: var(--gray-500); }
.day-col-holiday { font-size: 11px; color: var(--orange-dark); font-weight: 500; margin-top: 2px; }
.add-slot-btn {
  width: 36px; height: 36px; min-height: 36px; border: none; border-radius: var(--radius-sm);
  background: var(--green); color: #fff; font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .2s, transform .1s;
}
.add-slot-btn:active { transform: scale(.85); background: var(--green-dark); }

/* CARTE PLAGE */
.slot-card {
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 8px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .15s; border-left: 4px solid var(--gray-300); background: var(--gray-50);
}
.slot-card:active { transform: scale(.98); }
.slot-card.has-coach { border-left-color: var(--coach-color, var(--gray-300)); background: color-mix(in srgb, var(--coach-color, var(--gray-300)) 7%, #fff); }
.slot-time { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.slot-activity { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-top: 2px; line-height: 1.3; }
.slot-coaches { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.coach-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; color: #fff; }
.slot-delete {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(239,68,68,.1);
  color: var(--red); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .6; transition: opacity .2s, background .2s;
}
.slot-delete:active { opacity: 1; background: rgba(239,68,68,.2); }
.slot-empty { font-size: 12px; color: var(--gray-300); font-style: italic; text-align: center; padding: 16px 8px; }

/* BOUTON FLOTANT — APLAT VERT */
.fab {
  position: fixed; bottom: 20px; right: 16px; width: 56px; height: 56px;
  border: none; border-radius: 50%; background: var(--green); color: #fff;
  font-size: 28px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
  cursor: pointer; z-index: 30; transition: transform .15s, background .2s;
}
.fab:active { transform: scale(.88); background: var(--green-dark); }

/* BOTTOM SHEETS */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width:640px) { .sheet-overlay { align-items: center; } }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.4); animation: fadeIn .2s ease-out; }
.sheet {
  position: relative; background: #fff; width: 100%; max-width: 460px;
  border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto;
  animation: slideUp .25s ease-out; -webkit-overflow-scrolling: touch;
}
@media (min-width:640px) { .sheet { border-radius: var(--radius); } }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--gray-300); margin: 8px auto 4px; }
@media (min-width:640px) { .sheet-handle { display: none; } }
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; background: #fff; border-radius: 20px 20px 0 0; z-index: 5;
}
.sheet-header h2 { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.sheet-close {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--gray-100); color: var(--gray-500); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.sheet-close:active { background: var(--gray-200); }
.sheet-body { padding: 16px; padding-bottom: 32px; }

/* FORMULAIRES */
.form-row { margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.input-large {
  width: 100%; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  padding: 12px; font-size: 16px; outline: none;
  transition: border-color .2s, box-shadow .2s; background: #fff;
}
.input-large:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(150,201,61,.25); }
select.input-large { cursor: pointer; -webkit-appearance: none; appearance: none; }
.coach-count { font-size: 12px; color: var(--gray-500); }
.coach-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coach-pick-btn {
  display: flex; align-items: center; gap: 8px; padding: 12px;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--gray-700); background: #fff;
  cursor: pointer; transition: all .15s; text-align: left;
}
.coach-pick-btn:active { transform: scale(.95); }
.coach-pick-btn.selected { color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.coach-pick-btn .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.coach-pick-btn.selected .dot { background: rgba(255,255,255,.4) !important; }
.coach-pick-btn .check { margin-left: auto; font-size: 14px; }

/* BOUTONS — APLATS */
.btn-primary {
  width: 100%; border: none; border-radius: var(--radius);
  background: var(--green); color: #fff; padding: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .1s, background .2s;
}
.btn-primary:active { transform: scale(.95); background: var(--green-dark); }
.btn-dashed {
  width: 100%; border: 2px dashed var(--green); background: transparent;
  color: var(--green-darker); border-radius: var(--radius); padding: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 12px;
  transition: background .2s, transform .1s;
}
.btn-dashed:active { transform: scale(.97); background: var(--green-soft); }
.btn-orange {
  width: 100%; border: none; border-radius: var(--radius);
  background: var(--orange); color: #fff; padding: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .1s, background .2s;
}
.btn-orange:active { transform: scale(.95); background: var(--orange-dark); }

/* LISTE ENTRAÎNEURS */
.coach-list { display: flex; flex-direction: column; gap: 8px; }
.coach-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gray-50); border-radius: var(--radius-sm); padding: 10px 12px;
}
.coach-row-info { display: flex; align-items: center; gap: 8px; }
.coach-row-dot { width: 16px; height: 16px; border-radius: 50%; }
.coach-row-name { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.coach-del-btn {
  width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
  background: var(--orange-soft); color: var(--orange-dark); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* PALETTE COULEURS */
.color-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s;
}
.color-swatch:active { transform: scale(.85); }
.color-swatch.selected { border-color: var(--gray-800); transform: scale(1.15); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gray-800); }

/* MODALE DUPLICATION */
.dup-info {
  background: var(--orange-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 16px; font-size: 14px; color: var(--gray-800);
  line-height: 1.5;
}
.dup-info strong { color: var(--orange-dark); }

/* TOAST */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--gray-800); color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 60;
  animation: toastIn .3s ease-out; max-width: 90%; text-align: center;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* === Barre navigation sans menu déroulant === */
.week-bar-bottom { justify-content: center; }
.week-select { display: none; }
.today-btn { flex: 1; max-width: 200px; }
.dup-btn { flex: 1; max-width: 240px; }