:root {
  --sage:        #7E6749;
  --sage-dark:   #6B5638;
  --sage-mid:    #AC8C64;
  --sage-light:  #C2A178;
  --sage-pale:   #F0E1C8;
  --cream:       #FAF6EE;
  --white:       #FFFFFF;
  --terracotta:  #B08A5E;
  --terracotta-light: #E3CBA6;
  --text:        #3A3A3A;
  --text-light:  #6B7280;
  --shadow-soft: rgba(0,0,0,0.08);
  --r-card: 18px;
  --r-btn: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin:0; font-family:'Nunito',sans-serif; background: var(--cream); color: var(--text); overflow-x:hidden; }
button, a, select, input, textarea, .nav-item, .cal-day, .rdv-item { touch-action: manipulation; }

/* GRILLE TABLEAU DE BORD */
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }

/* BOUTON MODE SOMBRE MOBILE (masqué sur desktop, affiché dans la media query mobile) */
#mobile-dark-toggle { display:none; }

/* LOGIN GATE */
#login-gate { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:1000; padding:16px 16px 58px; transition: opacity .42s ease, filter .42s ease;
  background: linear-gradient(150deg, #FAF3E8 0%, #F0E1C8 45%, #E3CBA6 100%);
}
#login-gate.login-exit { opacity:0; filter: blur(6px); pointer-events:none; }
.login-box {
  background: rgba(255,254,251,0.94);
  border-radius: 20px;
  padding: 36px 30px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(124,96,60,0.25);
  transition: transform .42s cubic-bezier(.4,0,.2,1), opacity .38s ease;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.6);
}
#login-gate.login-exit .login-box { transform: scale(.82); opacity:0; }
.login-box h1 { font-family:'Fredoka One',cursive; color: #6B5638; font-size:1.6rem; margin: 0 0 6px; display:flex; align-items:center; justify-content:center; gap:10px; }
.login-box p { color: rgba(58,58,58,0.8); font-size:.92rem; margin-bottom: 18px; }
.login-box input { width:100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.08); font-size:1rem; margin-bottom:12px; font-family:'Nunito',sans-serif; background: rgba(255,255,255,0.9); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); }
.login-box input::placeholder { color: #A8A8A8; }
.login-box button { width:100%; padding: 12px; border:none; border-radius: 12px; background: var(--sage-light); color:#ffffff; font-weight:900; font-size:1rem; cursor:pointer; box-shadow: 0 10px 20px rgba(194,161,120,0.35); transition: transform .18s ease, background .18s ease; }
.login-box button:hover { transform: translateY(-2px); background: var(--sage-mid); }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(18px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-box { animation: fadeSlideIn .48s cubic-bezier(.2,.8,.2,1); }
.login-box .login-error { min-height:18px; margin-bottom:6px; }
.login-box .login-brand { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; margin-bottom:12px; }
.login-logo { width:76px; height:76px; object-fit:contain; }
.login-footer { position:absolute; right:16px; bottom:18px; left:16px; display:flex; justify-content:center; gap:18px; color:rgba(58,58,58,.64); font-size:.72rem; font-weight:700; }
.login-error { color:#C0392B; font-size:.82rem; margin-bottom: 10px; min-height: 18px; }

/* APP LAYOUT */
#app { display:none; min-height:100vh; min-height:100dvh; }
#app.show { display:flex; }
#app.app-enter .sidebar { animation: appEnterSide .5s cubic-bezier(.2,.7,.3,1) both; }
#app.app-enter .main { animation: appEnterMain .55s cubic-bezier(.2,.7,.3,1) .12s both; }
@keyframes appEnterSide { from { opacity:0; transform: translateX(-16px); } to { opacity:1; transform:none; } }
@keyframes appEnterMain { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
.sidebar { width: 230px; background: var(--white); border-right: 1px solid #eee; padding: 24px 14px; flex-shrink:0; display:flex; flex-direction:column; }
.sidebar .logo { font-family:'Fredoka One',cursive; color: var(--sage); font-size:1.2rem; padding: 0 10px 24px; text-align:center; }
.sidebar .logo span { display:block; font-family:'Nunito',sans-serif; font-size:.7rem; color: var(--text-light); font-weight:700; }
.sidebar .logo .logo-image {
  display:block;
  width:112px;
  height:112px;
  object-fit:contain;
  margin:0 auto 9px;
}
/* Icon styling for logo and headers */
.sidebar .logo .logo-icon { margin-right:8px; font-size:1.25rem; vertical-align:middle; }
.login-box h1 .header-icon { margin-right:8px; font-size:1.2rem; vertical-align:middle; }
.nav-item { display:flex; align-items:center; gap:10px; padding: 12px 14px; border-radius: 12px; cursor:pointer; font-weight:800; font-size:.92rem; color: var(--text); margin-bottom:4px; transition: background .15s; }
.nav-item:hover { background: var(--cream); }
.nav-item.active { background: var(--sage-pale); color: var(--sage); }
.nav-item .ic { font-size:1.1rem; }
.sidebar-footer { margin-top:auto; padding: 12px 14px; font-size:.78rem; color: var(--text-light); }
.sidebar-footer a { color: var(--terracotta); font-weight:800; text-decoration:none; cursor:pointer; }

.main { flex-grow:1; padding: 28px 32px 92px; overflow-y:auto; min-width:0; }
.app-footer { position:fixed; z-index:490; right:0; bottom:0; left:230px; padding:14px 32px; background:var(--white); border-top:1px solid rgba(0,0,0,.09); box-shadow:0 -8px 26px rgba(0,0,0,.08); color:var(--text-light); }
.footer-grid { display:grid; grid-template-columns:1.5fr repeat(3, 1fr); gap:32px; max-width:1240px; margin:0 auto; }
.footer-logo { color:var(--sage); font-family:'Fredoka One',cursive; font-size:1.35rem; }
.footer-desc { max-width:370px; margin:9px 0 0; font-size:.78rem; line-height:1.55; }
.footer-col { display:flex; flex-direction:column; gap:6px; }
.footer-col h4 { margin:0 0 4px; color:var(--text); font-size:.84rem; }
.app-footer a { color:var(--text-light); font-size:.76rem; font-weight:700; text-decoration:none; }
.app-footer a:hover { color:var(--sage); text-decoration:underline; }
.footer-bottom { display:flex; justify-content:space-between; gap:16px; max-width:1240px; margin:0 auto; font-size:.7rem; font-weight:700; }

/* RECHERCHE GLOBALE */
.global-search-wrap { position:relative; margin-bottom:20px; max-width:480px; }
.global-search-wrap input { width:100%; padding: 12px 16px; border-radius: 12px; border: 1px solid #ddd; font-family:'Nunito',sans-serif; font-size:.9rem; background: var(--white); }
.global-search-results { position:absolute; top:calc(100% + 6px); left:0; right:0; background: var(--white); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); max-height:340px; overflow-y:auto; opacity:0; pointer-events:none; transform: translateY(-6px); transition: opacity .15s, transform .15s; z-index:80; }
.global-search-results.show { opacity:1; pointer-events:auto; transform:none; }
.gsr-group-title { padding:10px 14px 4px; font-size:.68rem; font-weight:900; text-transform:uppercase; letter-spacing:.4px; color: var(--text-light); }
.gsr-item { padding:10px 14px; display:flex; justify-content:space-between; align-items:center; gap:10px; cursor:pointer; border-bottom:1px solid #f2f2f2; }
.gsr-item:hover { background: var(--cream); }
.gsr-item:last-child { border-bottom:none; }
.gsr-item-name { font-weight:800; font-size:.86rem; }
.gsr-item-sub { font-size:.76rem; color: var(--text-light); }
.gsr-empty { padding:16px; text-align:center; color: var(--text-light); font-size:.82rem; }
.rdv-client-search-wrap { position:relative; flex-grow:1; }
.rdv-client-search-wrap .global-search-results { max-height:220px; }

/* FIDÉLITÉ */
.fidelite-box { background: var(--cream); border-radius: 14px; padding: 14px 16px; margin-top:16px; text-align:left; }
.fidelite-label { font-size:.76rem; font-weight:800; color: var(--text-light); text-transform:uppercase; letter-spacing:.3px; margin-bottom:8px; }
.fidelite-bar { background:#E2E2E2; border-radius:20px; height:10px; overflow:hidden; }
.fidelite-bar-fill { background: linear-gradient(90deg, var(--sage), var(--terracotta)); height:100%; width:0%; transition: width .3s ease; }
.fidelite-count { font-size:.78rem; font-weight:800; color: var(--sage); margin-top:6px; text-align:right; }

/* ANNULATIONS TARDIVES */
.annulation-box { background: var(--cream); border-radius: 14px; padding: 14px 16px; margin-top:10px; text-align:left; }
.annulation-box.annulation-alerte { background:#FCE9E9; }
body.dark-mode .annulation-box.annulation-alerte { background:#3A2323; }
.annulation-banner { background:#E53935; color:#fff; font-weight:800; font-size:.76rem; border-radius:8px; padding:6px 10px; margin-bottom:10px; text-align:center; }

/* BLOCAGES DE CRÉNEAUX */
.week-blocage { position:absolute; left:0; right:0; background: repeating-linear-gradient(45deg, rgba(120,120,120,0.14), rgba(120,120,120,0.14) 8px, rgba(120,120,120,0.22) 8px, rgba(120,120,120,0.22) 16px); color:#6B6B6B; font-size:.66rem; font-weight:800; padding:4px 6px; cursor:pointer; z-index:5; border-left:3px solid #999; }
.view { display:none; }
.view.active { display:block; }
.view-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 22px; flex-wrap:wrap; gap:12px; }
.view-header h2 { font-family:'Fredoka One',cursive; font-size:1.5rem; margin:0; }
.btn-primary { background: var(--sage); color:#fff; border:none; border-radius: var(--r-btn); padding: 11px 20px; font-weight:800; font-size:.88rem; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.btn-primary:hover { background: var(--sage-dark); }
.btn-secondary { background: var(--white); color: var(--text); border:1px solid #ddd; border-radius: var(--r-btn); padding: 9px 16px; font-weight:700; font-size:.85rem; cursor:pointer; }
.btn-secondary.active { background: var(--sage-dark); color:#fff; border-color: rgba(0,0,0,0.06); }

/* REPERTOIRE TABLE */
.toolbar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.toolbar input { padding: 10px 14px; border-radius: 10px; border: 1px solid #ddd; font-size:.85rem; font-family:'Nunito',sans-serif; min-width:160px; flex-grow:1; }
.table-card { background: var(--white); border-radius: var(--r-card); overflow:hidden; box-shadow: 0 2px 12px var(--shadow-soft); }
table { width:100%; border-collapse: collapse; }
thead th { text-align:left; font-size:.75rem; text-transform:uppercase; letter-spacing:.4px; color: var(--text-light); padding: 14px 16px; border-bottom: 1px solid #eee; background: var(--cream); }
tbody td { padding: 13px 16px; font-size:.88rem; border-bottom: 1px solid #f2f2f2; }
tbody tr:hover { background: var(--cream); }
tbody tr { cursor:pointer; }
.client-name { font-weight:800; }
.client-avatar { width:30px; height:30px; border-radius:50%; background: var(--sage-pale); display:inline-flex; align-items:center; justify-content:center; margin-right:10px; font-size:.85rem; }
.client-avatar-photo { object-fit:cover; display:block; flex:0 0 30px; }
.row-flex { display:flex; align-items:center; }
.tag { background: var(--sage-pale); color: var(--sage); padding: 3px 10px; border-radius: 20px; font-size:.74rem; font-weight:800; }
.empty-row td { text-align:center; padding: 40px; color: var(--text-light); }
.action-btn { background:none; border:none; color: var(--text-light); cursor:pointer; font-size:.95rem; padding:4px 6px; }
.action-btn:hover { color: #C0392B; }
.presta-badge { display:inline-block; font-size:.72rem; font-weight:800; padding:4px 10px; border-radius:6px; }
.presta-badge.upcoming { background: var(--sage); color:#fff; }
.presta-badge.done { background:#EDEDED; color:#777; }
.drag-col { width:26px; padding-right:0 !important; }
.drag-handle { cursor:grab; color: var(--text-light); font-size:1rem; user-select:none; }
tr.draggable-row.dragging { opacity:.35; }
tr.drag-over-row { box-shadow: inset 0 2px 0 var(--sage); }

/* CALENDAR */
.cal-nav { display:flex; align-items:center; gap:14px; }
.cal-nav button:not(.btn-secondary) { background: var(--white); border:1px solid #ddd; border-radius: 8px; width:34px; height:34px; cursor:pointer; font-size:1rem; }
.cal-month-label { font-weight:800; font-size:1rem; min-width:160px; text-align:center; }
.cal-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:8px; }
.cal-dow { text-align:center; font-size:.74rem; font-weight:800; color: var(--text-light); padding-bottom:6px; }
.cal-day { background: var(--white); border-radius: 12px; min-height: 96px; padding: 8px; box-shadow: 0 1px 6px var(--shadow-soft); cursor:pointer; transition: box-shadow .15s; }
.cal-day:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.cal-day.other-month { opacity:.35; }
.cal-day.today { border: 2px solid var(--sage); }
.cal-daynum { font-size:.8rem; font-weight:800; margin-bottom:6px; }
.cal-rdv { background: var(--sage-pale); color: var(--sage); font-size:.7rem; font-weight:800; border-radius: 6px; padding: 2px 6px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-rdv.more { background: none; color: var(--text-light); font-weight:700; }

.day-rdv-list { display:flex; flex-direction:column; gap:8px; margin-top:18px; }
.rdv-item { background: var(--white); border-radius: 14px; padding: 12px 16px; display:flex; align-items:center; justify-content:space-between; box-shadow: 0 1px 6px var(--shadow-soft); }
.rdv-item .rdv-time { font-family:'Fredoka One',cursive; color: var(--sage); font-size:1rem; min-width:60px; }
.rdv-item .rdv-info strong { display:block; font-size:.9rem; }
.rdv-item .rdv-info span { font-size:.78rem; color: var(--text-light); }
.rdv-item .rdv-actions { display:flex; gap:6px; }

/* WEEK PLANNING */
.week-card { background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); overflow:hidden; }
.week-toprow { display:flex; align-items:center; justify-content:space-between; padding: 14px 18px; border-bottom: 1px solid #eee; flex-wrap:wrap; gap:10px; }
.week-range-label { font-weight:800; font-size:1.02rem; color: var(--text); }
.cal-legend { display:flex; flex-wrap:wrap; gap:10px 16px; padding: 10px 18px; border-bottom: 1px solid #eee; }
.cal-legend-item { display:flex; align-items:center; gap:6px; font-size:.72rem; font-weight:700; color: var(--text-light); }
.cal-legend-swatch { width:12px; height:12px; border-radius:4px; flex-shrink:0; }
.week-toprow .cal-nav button:not(.btn-secondary) { width:32px; height:32px; }
.week-scroll { overflow-x:auto; }
.week-grid-inner { min-width: 760px; }
.week-header-row { display:grid; grid-template-columns: 56px repeat(6, 1fr); border-bottom: 1px solid #eee; }
.week-daycol-header { text-align:center; padding:10px 4px; font-weight:800; font-size:.8rem; color: var(--text-light); border-left: 1px solid #f2f2f2; }
.week-daycol-header.today { color: var(--sage); background: var(--sage-pale); }
.week-daycol-header .ddate { font-size:.72rem; font-weight:700; opacity:.8; }
.week-body { display:grid; grid-template-columns: 56px repeat(6, 1fr); position:relative; }
.week-timecol { position:relative; border-right:1px solid #f2f2f2; }
.week-timecol .tlabel { position:absolute; right:6px; transform: translateY(-50%); font-size:.68rem; font-weight:700; color: var(--text-light); }
.week-timecol .tlabel.half { font-size:.6rem; font-weight:600; opacity:.65; }
.week-daycol { position:relative; border-left: 1px solid #f2f2f2; background-image: repeating-linear-gradient(to bottom, #F4EFE4 0, #F4EFE4 1px, transparent 1px, transparent var(--hour-h)), repeating-linear-gradient(to bottom, #FAF6EE 0, #FAF6EE 1px, transparent 1px, transparent var(--half-hour-h)); cursor:pointer; }
.week-event { position:absolute; left:3px; right:3px; border-radius:9px; padding:5px 7px; color:#fff; font-size:.7rem; line-height:1.25; font-weight:800; overflow:hidden; cursor:grab; box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: filter .12s, box-shadow .15s; touch-action:none; user-select:none; min-height:20px; }
.week-event.dragging { cursor:grabbing; opacity:.88; z-index:50; box-shadow: 0 8px 22px rgba(0,0,0,0.3); transition:none; will-change: top, left; transform: translateZ(0); }
.week-event:hover { filter: brightness(1.06); z-index:45; box-shadow: 0 4px 14px rgba(0,0,0,0.22); }
.week-event .we-time { display:block; font-size:.68rem; opacity:.92; font-weight:700; }
.week-event .we-name { display:block; font-family:'Nunito',sans-serif; font-size:.78rem; margin-top:1px; color:#fff; font-weight:800; text-shadow:0 1px 1px rgba(0,0,0,.3); }
.week-event .we-detail { display:block; font-weight:600; opacity:.95; }
@media (max-width: 720px) { .week-grid-inner { min-width: 620px; } }

/* MODAL */
.modal-overlay { position: fixed; inset:0; background: rgba(58,58,58,0.55); display:flex; align-items:center; justify-content:center; z-index: 999; padding: 20px; opacity:0; pointer-events:none; transition: opacity .2s; }
.modal-overlay.show { opacity:1; pointer-events:auto; }
.modal-box { background: var(--white); border-radius: 20px; padding: 30px 28px; max-width: 460px; width:100%; max-height: 86vh; overflow-y:auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-title { font-family:'Fredoka One',cursive; font-size:1.25rem; margin-bottom: 18px; }
.modal-close { float:right; background:none; border:none; font-size:1.3rem; cursor:pointer; color: var(--text-light); }
.form-group { margin-bottom: 14px; }
.form-group label { display:block; font-size:.78rem; font-weight:800; margin-bottom:5px; color: var(--text-light); }
.form-group input, .form-group select, .form-group textarea { width:100%; padding: 10px 13px; border-radius: 10px; border: 1px solid #ddd; font-family:'Nunito',sans-serif; font-size:.88rem; }
.form-group textarea { min-height: 60px; resize:vertical; }
.form-row2 { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.animaux-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; margin-bottom:14px; }
.animal-chip { background: var(--cream); border-radius:10px; padding:8px 12px; display:flex; align-items:center; justify-content:space-between; font-size:.84rem; }
.animal-chip b { display:block; }
.animal-chip span { color: var(--text-light); font-size:.76rem; }
.add-animal-row { display:flex; gap:6px; }
.add-animal-row input { flex-grow:1; }
.add-animal-row button { background: var(--sage-pale); color: var(--sage); border:none; border-radius:8px; padding: 0 12px; font-weight:800; cursor:pointer; }
.modal-submit { width:100%; background: var(--sage); color:#fff; border:none; border-radius: 12px; padding: 12px; font-weight:800; font-size:.95rem; cursor:pointer; margin-top:8px; }
.modal-delete { width:100%; background: none; color:#C0392B; border:none; padding: 10px; font-weight:800; font-size:.84rem; cursor:pointer; margin-top:6px; }

/* COMPTE RENDU CHEVAL */
.muscle-map-help { color:var(--text-light); font-size:.8rem; margin:-4px 0 10px; }
.muscle-map { position:relative; max-width:760px; margin:0 auto; border:1px solid #e7ddcc; border-radius:14px; overflow:hidden; background:var(--cream); }
.muscle-map img { display:block; width:100%; height:auto; }
.muscle-zone { position:absolute; transform:translate(-50%,-50%); border:1px solid var(--sage); background:rgba(255,255,255,.9); color:var(--sage-dark); border-radius:16px; padding:3px 8px; font:800 .67rem 'Nunito',sans-serif; cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.14); }
.muscle-zone:hover, .muscle-zone.active { background:var(--sage); color:#fff; }
.muscle-zone.active::before { content:'✓ '; }
.zone-encolure { left:34%; top:29%; }.zone-epaule { left:38%; top:45%; }.zone-dos { left:57%; top:38%; }.zone-lombaires { left:68%; top:44%; }.zone-croupe { left:76%; top:35%; }.zone-avant-main { left:40%; top:68%; }.zone-arriere-main { left:77%; top:68%; }.zone-ventre { left:57%; top:56%; }
@media (max-width:600px) { .muscle-zone { font-size:.55rem; padding:2px 5px; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--sage); color:#fff; padding: 12px 24px; border-radius: 50px; font-weight:800; font-size:.85rem; opacity:0; pointer-events:none; transition: all .25s; z-index:1100; }

/* POST-SAVE QUICK MENU */
.postsave-overlay { position:fixed; inset:0; background: rgba(58,58,58,0.5); display:flex; align-items:center; justify-content:center; z-index: 1200; padding:20px; opacity:0; pointer-events:none; transition: opacity .2s; }
.postsave-overlay.show { opacity:1; pointer-events:auto; }
.postsave-box { background: var(--white); border-radius: 20px; padding: 26px 24px; width:100%; max-width:340px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); text-align:center; }
.postsave-title { font-family:'Fredoka One',cursive; font-size:1.1rem; margin-bottom: 16px; }
.postsave-actions { display:flex; flex-direction:column; gap:8px; margin-bottom: 10px; }
.postsave-actions button { width:100%; background: var(--sage); color:#fff; border:none; border-radius: 12px; padding: 11px; font-weight:800; font-size:.86rem; cursor:pointer; }
.postsave-actions button:hover { background: var(--sage-dark); }
.postsave-close { width:100%; background:none; border:none; color: var(--text-light); font-weight:800; font-size:.84rem; padding:8px; cursor:pointer; }
.toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

/* BOUTIQUE (admin view) */
.produits-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:18px; }
.produit-card { background: var(--white); border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px var(--shadow-soft); }
.produit-img { font-size:2.6rem; background: var(--sage-pale); border-radius: 12px; height:120px; display:flex; align-items:center; justify-content:center; margin-bottom:10px; overflow:hidden; }
.produit-img img { width:100%; height:100%; object-fit:cover; }
.produit-name { font-weight:800; font-size:.95rem; }
.produit-categorie { display:inline-block; margin: 4px 0 8px; }
.produit-desc { font-size:.78rem; color: var(--text-light); margin: 4px 0 10px; }
.produit-footer { display:flex; align-items:center; justify-content:space-between; }
.produit-price { font-family:'Fredoka One',cursive; color: var(--sage); }
.produit-photo-wrap { width:100%; height:130px; border-radius:14px; background: var(--sage-pale); display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:pointer; font-size:2.4rem; position:relative; }
.produit-photo-wrap img { width:100%; height:100%; object-fit:cover; }
.produit-photo-wrap .photo-edit-hint { position:absolute; inset:auto 0 0 0; background:rgba(0,0,0,.45); color:#fff; font-size:.65rem; font-weight:800; text-align:center; padding:4px 0; opacity:0; transition:opacity .15s; }
.produit-photo-wrap:hover .photo-edit-hint { opacity:1; }
.produit-variantes-tag { font-size:.72rem; color: var(--sage); font-weight:700; margin:-4px 0 10px; }

@media (max-width: 760px) {
  #login-gate { padding-bottom:78px; }
  .login-footer { bottom:18px; flex-direction:column; align-items:center; gap:2px; font-size:.66rem; }
  #app.show { flex-direction: column; }
  .sidebar {
    order: 2; width:100%; flex-direction:row; overflow-x:auto; -webkit-overflow-scrolling:touch;
    padding: 8px 6px; position: sticky; bottom: 0; left:0; z-index: 500;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.10); gap:4px; justify-content:space-around;
    border-top-left-radius:18px; border-top-right-radius:18px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar .logo, .sidebar-footer { display:none; }
  .nav-item { white-space:nowrap; flex-direction:column; gap:2px; font-size:.64rem; padding:7px 8px; text-align:center; min-width:56px; border-radius:14px; margin-bottom:0; }
  .nav-item.active { background: var(--sage-pale); }
  .nav-item .ic { font-size:1.3rem; }
  .nav-badge, .nav-badge-alert { margin-left:0; }
  .main { order:1; padding: 16px 14px calc(138px + env(safe-area-inset-bottom, 0px)); }
  .app-footer { left:0; bottom:calc(88px + env(safe-area-inset-bottom, 0px)); padding:10px 16px; }
  .footer-grid { grid-template-columns:1fr 1fr; gap:22px 16px; }
  .footer-desc { font-size:.72rem; }
  .footer-bottom { flex-direction:column; align-items:center; gap:3px; margin:0; font-size:.66rem; line-height:1.4; text-align:center; }
  .cal-day { min-height: 60px; }
  .view-header { gap:10px; }
  .view-header h2 { font-size:1.2rem; }
  .btn-primary, .btn-secondary { min-height:44px; }
  .toolbar input { min-height:44px; }
  .fiche-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-row { grid-template-columns: 1fr 1fr; }
  .produits-grid { grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap:12px; }
  .dash-grid { grid-template-columns: 1fr; }

  /* Bouton mode sombre flottant (mobile) */
  #mobile-dark-toggle {
    display:flex; position:fixed; top:12px; right:12px; z-index:600;
    width:44px; height:44px; border-radius:50%; background:var(--white);
    border:1px solid #ddd; box-shadow:0 4px 14px rgba(0,0,0,.18);
    align-items:center; justify-content:center; font-size:1.25rem; cursor:pointer;
  }
  .global-search-wrap { max-width:none; padding-right:54px; }

  .btn-call, .btn-faite { min-height:44px; justify-content:center; }
  .week-scroll { -webkit-overflow-scrolling:touch; }
  .table-card tbody td { word-break:break-word; overflow-wrap:anywhere; }

  .table-card { overflow:visible; background:none; box-shadow:none; border-radius:0; }
  .table-card table, .table-card thead, .table-card tbody { display:block; width:100%; }
  .table-card thead { display:none; }
  .table-card tbody tr {
    display:block; background: var(--white); border-radius: 16px; padding: 6px 4px;
    margin-bottom: 12px; box-shadow: 0 2px 12px var(--shadow-soft);
  }
  .table-card tbody tr.empty-row { box-shadow:none; background:none; }
  .table-card tbody td {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding: 9px 14px; border-bottom: 1px solid #f2f2f2; text-align:right;
  }
  .table-card tbody tr > td:first-child { border-top-left-radius:16px; border-top-right-radius:16px; }
  .table-card tbody tr > td:last-child { border-bottom:none; border-bottom-left-radius:16px; border-bottom-right-radius:16px; }
  .table-card tbody td[data-label]::before {
    content: attr(data-label); font-size:.68rem; font-weight:800; text-transform:uppercase;
    letter-spacing:.3px; color: var(--text-light); text-align:left; flex-shrink:0;
  }
  .table-card tbody td[data-label="Client"],
  .table-card tbody td[data-label="Nom"] {
    justify-content:flex-start; background: var(--cream); font-size:1rem;
    border-top-left-radius:16px; border-top-right-radius:16px;
  }
  .table-card tbody td[data-label="Client"]::before,
  .table-card tbody td[data-label="Nom"]::before { content:none; }
  .table-card tbody td.drag-col, .table-card tbody td.td-actions { padding:6px 14px; }
  .table-card tbody td.drag-col::before, .table-card tbody td.td-actions::before { content:none; }
  .table-card tbody td.drag-col:empty { display:none; }
  .empty-row td { box-shadow:none !important; background:none !important; }
  .fab, .fiche-save-fab { bottom:calc(154px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom:calc(138px + env(safe-area-inset-bottom, 0px)); max-width:calc(100vw - 28px); text-align:center; }
}

@media (max-width: 480px) {
  .main { padding:12px 10px calc(138px + env(safe-area-inset-bottom, 0px)); }
  .view-header { flex-direction:column; align-items:stretch; }
  .view-header .btn-primary, .view-header .btn-secondary { width:100%; justify-content:center; }
  .form-row2 { grid-template-columns: 1fr; }
  .fc-grid-2, .fc-grid-3, .fc-grid-5 { grid-template-columns: 1fr; }
  .fiche-grid { grid-template-columns: 1fr; }
  .filters-row { grid-template-columns: 1fr; }
  .filters-card { padding: 14px 16px; }
  .modal-box {
    max-width: 100%; width:100%; height:100dvh; max-height:100dvh;
    border-radius: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    margin: 0;
  }
  .modal-overlay { padding:0; align-items:stretch; }
  .table-card { border-radius: 0; }

  /* Popup détail RDV plein écran sur mobile */
  .rdvd-box {
    width:100%; max-width:100%; max-height:100dvh; height:100dvh;
    border-radius:0; overflow-y:auto;
  }
  .rdvd-header { border-radius:0; padding:18px 16px 14px; }
  .rdvd-body { padding:18px 16px; }
  .rdvd-footer { padding:14px 16px calc(14px + env(safe-area-inset-bottom,0px)); position:sticky; bottom:0; background:var(--white); }
  .rdvd-tabs { position:sticky; top:0; background:var(--white); z-index:5; }

  .fiche-tabs { position:sticky; top:0; z-index:5; }
  .cal-month-label { min-width: auto; font-size:.9rem; }
  .week-toprow { padding: 10px 12px; }
  .produits-grid { grid-template-columns: 1fr 1fr; }
  .fiche-wrap { gap: 14px; }
  .fiche-left { padding: 16px 14px; }
  .fiche-body { padding: 16px 14px; }
  .rdv-item { flex-wrap:wrap; gap:6px; }
  .demande-card, .tache-card { flex-direction:column; align-items:stretch; }
  .demande-card .demande-actions, .tache-card .tache-actions { justify-content:flex-start; }
  #demande-banner-wrap { left:12px; right:12px; max-width:none; }
}

/* ANIMAUX */
.nav-badge { background:#E2E2E2; color: var(--text-light); font-size:.7rem; font-weight:800; border-radius:10px; padding:1px 7px; margin-left:auto; }
.nav-item.active .nav-badge { background: var(--sage); color:#fff; }

/* ===== NOTIFICATIONS DEMANDES RDV ===== */
.nav-badge-alert { background:#E53935 !important; color:#fff !important; animation: badgePulse 1.4s ease-in-out infinite; }
.nav-item-demandes.active .nav-badge-alert { background:#E53935 !important; }
@keyframes badgePulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229,57,53,0.55); } 50% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(229,57,53,0); } }

#demande-banner-wrap { position: fixed; top: 16px; right: 16px; z-index: 3000; display:flex; flex-direction:column; gap:10px; max-width: 360px; }
.demande-banner {
  background: #fff; border-left: 6px solid #E53935; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.22); animation: bannerIn .35s ease, bannerGlow 1.6s ease-in-out infinite;
  cursor:pointer;
}
@keyframes bannerIn { from { transform: translateX(40px); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes bannerGlow { 0%,100% { box-shadow: 0 10px 34px rgba(0,0,0,0.22), 0 0 0 0 rgba(229,57,53,0.35); } 50% { box-shadow: 0 10px 34px rgba(0,0,0,0.22), 0 0 0 8px rgba(229,57,53,0); } }
.demande-banner-title { font-weight:900; color:#E53935; font-size:.86rem; text-transform:uppercase; letter-spacing:.4px; margin-bottom:4px; }
.demande-banner-name { font-family:'Fredoka One',cursive; font-size:1.05rem; margin-bottom:2px; }
.demande-banner-info { font-size:.82rem; color: var(--text-light); }
.demande-banner-close { position:absolute; top:10px; right:12px; background:none; border:none; font-size:1rem; color:#bbb; cursor:pointer; }

.demande-card { background:#fff; border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 18px 20px; margin-bottom:14px; border-left: 5px solid #E53935; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; }
.demande-card.traitee { border-left-color:#ccc; opacity:.6; }
.demande-card .demande-nom { font-family:'Fredoka One',cursive; font-size:1.1rem; }
.demande-card .demande-details { font-size:.85rem; color: var(--text-light); margin-top:4px; line-height:1.6; }
.demande-card .demande-actions { display:flex; gap:8px; flex-wrap:wrap; }
.demande-card .demande-time { font-size:.72rem; color: var(--text-light); font-weight:700; }
.btn-call { background: var(--sage); color:#fff; border:none; border-radius: var(--r-btn); padding: 9px 16px; font-weight:800; font-size:.85rem; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }

/* ===== NOTIFICATIONS TÂCHES / À FAIRE ===== */
.nav-item-taches.active .nav-badge-alert { background:#E53935 !important; }
.tache-banner {
  background: #fff; border-left: 6px solid var(--terracotta); border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.22); animation: bannerIn .35s ease, bannerGlowOrange 1.6s ease-in-out infinite;
  cursor:pointer;
}
@keyframes bannerGlowOrange { 0%,100% { box-shadow: 0 10px 34px rgba(0,0,0,0.22), 0 0 0 0 rgba(176,138,94,0.35); } 50% { box-shadow: 0 10px 34px rgba(0,0,0,0.22), 0 0 0 8px rgba(176,138,94,0); } }
.tache-banner-title { font-weight:900; color: var(--terracotta); font-size:.86rem; text-transform:uppercase; letter-spacing:.4px; margin-bottom:4px; }
.tache-banner-name { font-family:'Fredoka One',cursive; font-size:1.05rem; margin-bottom:2px; }
.tache-banner-info { font-size:.82rem; color: var(--text-light); }
.tache-banner-close { position:absolute; top:10px; right:12px; background:none; border:none; font-size:1rem; color:#bbb; cursor:pointer; }

.tache-card { background:#fff; border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 16px 20px; margin-bottom:12px; border-left: 5px solid var(--terracotta); display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; }
.tache-card.faite { border-left-color: var(--sage-mid); opacity:.65; }
.tache-card.inactive { border-left-color:#ccc; opacity:.5; }
.tache-card .tache-nom { font-family:'Fredoka One',cursive; font-size:1.05rem; }
.tache-card .tache-details { font-size:.85rem; color: var(--text-light); margin-top:4px; }
.tache-card .tache-actions { display:flex; gap:8px; flex-wrap:wrap; }
.tache-jour-badge { display:inline-flex; align-items:center; justify-content:center; min-width:34px; height:34px; border-radius:50%; background: var(--sage-pale); color: var(--terracotta); font-weight:900; font-family:'Fredoka One',cursive; font-size:.95rem; }
.btn-faite { background: var(--sage); color:#fff; border:none; border-radius: var(--r-btn); padding: 9px 16px; font-weight:800; font-size:.85rem; cursor:pointer; }
.btn-faite:hover { opacity:.9; }
.tache-card.due { border-left-color: #E53935; animation: tacheBlink 1s linear infinite; }
.tache-card.due .tache-nom { color: #C0392B; }
@keyframes tacheBlink { 0% { box-shadow: 0 2px 12px rgba(0,0,0,0.06); } 50% { box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 8px rgba(229,57,53,0.06); } 100% { box-shadow: 0 2px 12px rgba(0,0,0,0.06); } }
.animaux-subtabs { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.animaux-subtab { display:flex; align-items:center; gap:8px; background: var(--white); border:1px solid #eee; border-radius: 10px; padding: 9px 14px; font-weight:800; font-size:.85rem; color: var(--text-light); cursor:pointer; }
.animaux-subtab:hover { background: var(--cream); }
.animaux-subtab.active { background: var(--sage-pale); color: var(--sage); border-color: var(--sage-pale); }
.animaux-subtab .nav-badge { background:#E2E2E2; color: var(--text-light); }
.animaux-subtab.active .nav-badge { background: var(--sage); color:#fff; }
.filters-card { background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 18px 20px; margin-bottom: 18px; }
.filters-row { display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.filters-row:last-child { margin-bottom:0; }
.filter-field label { display:block; font-size:.74rem; font-weight:800; color: var(--text-light); margin-bottom:5px; }
.filter-field input, .filter-field select { width:100%; padding: 9px 12px; border-radius: 9px; border: 1px solid #ddd; font-family:'Nunito',sans-serif; font-size:.85rem; }
.tournee-filters-card, .tournee-select-card { background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 18px 20px; }
.tournee-filters-row { display:grid; grid-template-columns: 1.3fr 1.7fr 1fr 0.9fr; gap: 14px; align-items:end; }
.tournee-generate-field { display:flex; align-items:flex-end; }
.tournee-select-row { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; }
.tournee-select-card .filter-field { flex:1; min-width:220px; }
.tournee-select-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
.tournee-selected-clients { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.tournee-client-chip { background: var(--sage-pale); color: var(--sage); padding: 8px 12px; border-radius: 999px; display:inline-flex; align-items:center; gap:10px; font-size:.85rem; }
.tournee-chip-remove { background: rgba(0,0,0,0.08); border:none; color: var(--text); font-weight:700; border-radius: 999px; padding: 5px 12px; cursor:pointer; font-size:.81rem; }
.tournee-chip-remove:hover { background: rgba(0,0,0,0.12); }
.tournee-empty { color: var(--text-light); font-size:.88rem; }
@media(max-width:960px) {
  .tournee-filters-row { grid-template-columns: 1fr; }
  .tournee-select-row { flex-direction:column; align-items:stretch; }
  .tournee-select-actions { width:100%; justify-content:flex-start; }
}
.table-toolbar { display:flex; justify-content:flex-end; gap:6px; margin-bottom:10px; }
.table-toolbar button { background: var(--white); border:1px solid #ddd; border-radius:8px; width:34px; height:34px; cursor:pointer; }
.sexe-icon.male { color:#3F8FE0; }
.sexe-icon.femelle { color:#E0568C; }
.pagination { display:flex; align-items:center; justify-content:center; gap:6px; padding: 16px; flex-wrap:wrap; }
.pagination button { background: var(--white); border:1px solid #ddd; border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:.85rem; font-weight:700; }
.pagination button.active { background: var(--text); color:#fff; border-color: var(--text); }
.pagination button:disabled { opacity:.4; cursor:default; }
.fab { position:fixed; right:28px; bottom:54px; width:54px; height:54px; border-radius:50%; background: var(--sage); color:#fff; border:none; font-size:2rem; font-weight:900; line-height:1; cursor:pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); display:flex; align-items:center; justify-content:center; }
.fab:hover { background: var(--sage-dark); }
.proprietaire-row { display:flex; gap:8px; align-items:center; }
.proprietaire-row select { flex-grow:1; }
.btn-icon-square { background: var(--sage); color:#fff; border:none; border-radius:10px; width:38px; height:38px; flex-shrink:0; cursor:pointer; font-weight:900; }
.form-section-title { text-transform:uppercase; font-size:.8rem; font-weight:900; color: var(--text-light); letter-spacing:.5px; margin: 18px 0 10px; padding-top:14px; border-top:1px solid #eee; }
.cat-card { background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 18px 20px; margin-bottom: 18px; }
.cat-card h3 { font-family:'Fredoka One',cursive; font-size:1.05rem; margin:0 0 4px; color: var(--sage); }
.cat-card .cat-sub { font-size:.8rem; color: var(--text-light); margin-bottom:14px; }
.cat-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.cat-chip { display:inline-flex; align-items:center; gap:8px; background: var(--sage-pale); color: var(--sage); padding: 6px 8px 6px 14px; border-radius: 20px; font-size:.82rem; font-weight:800; }
.cat-chip button { background: rgba(255,255,255,.6); border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; color: var(--sage); font-weight:900; line-height:1; display:flex; align-items:center; justify-content:center; font-size:.75rem; }
.cat-chip button:hover { background:#fff; color:#C0392B; }
.cat-empty { font-size:.82rem; color: var(--text-light); margin-bottom:14px; }
.cat-add-row { display:flex; gap:8px; max-width:420px; }
.cat-add-row input { flex-grow:1; padding: 10px 14px; border-radius: 10px; border: 1px solid #ddd; font-size:.85rem; font-family:'Nunito',sans-serif; }
.color-swatch { width:28px; height:28px; border-radius:50%; cursor:pointer; border:2px solid transparent; flex-shrink:0; }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.checkbox-row { display:flex; align-items:center; gap:8px; }
.checkbox-row input { width:auto; }
.toggle-row { display:flex; align-items:center; gap:10px; }
.switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch-slider { position:absolute; cursor:pointer; inset:0; background:#ddd; border-radius:24px; transition:.15s; }
.switch-slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.15s; }
.switch input:checked + .switch-slider { background: var(--sage); }
.switch input:checked + .switch-slider:before { transform: translateX(20px); }
.switch-label-pair { display:flex; align-items:center; gap:8px; font-size:.85rem; font-weight:800; color: var(--text-light); }
.switch-label-pair .on { color: var(--text); }
.photo-upload-row { display:flex; gap:8px; }
.photo-upload-row input { flex-grow:1; }
.color-strip { display:flex; gap:6px; flex-wrap:wrap; padding:10px; border:1px solid #ddd; border-radius:10px; }
.color-dot { width:26px; height:26px; border-radius:50%; cursor:pointer; border:2px solid transparent; flex-shrink:0; }
.color-dot.selected { border-color: var(--text); }

/* FICHE ANIMAL */
.fiche-back { display:inline-flex; align-items:center; gap:6px; color: var(--text-light); font-weight:800; cursor:pointer; margin-bottom:16px; font-size:.85rem; }
.fiche-back:hover { color: var(--sage); }
.fiche-wrap { display:flex; gap:22px; align-items:flex-start; }
.fiche-left { width:280px; flex-shrink:0; background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); padding: 22px 20px; position:relative; }
.fiche-trash { position:absolute; top:14px; right:14px; background:none; border:none; font-size:1.05rem; cursor:pointer; color: var(--text-light); }
.fiche-trash:hover { color:#C0392B; }
.fiche-photo-wrap { width:150px; height:150px; border-radius:50%; background: var(--sage-pale); margin: 0 auto 14px; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:pointer; font-size:3.2rem; position:relative; }
.fiche-photo-wrap img { width:100%; height:100%; object-fit:cover; }
.fiche-photo-wrap .photo-edit-hint { position:absolute; inset:auto 0 0 0; background:rgba(0,0,0,.45); color:#fff; font-size:.65rem; font-weight:800; text-align:center; padding:4px 0; opacity:0; transition:opacity .15s; }
.fiche-photo-wrap:hover .photo-edit-hint { opacity:1; }
.fiche-gallery-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap:12px; }
.fiche-gallery-item { position:relative; width:100%; padding-top:100%; border-radius:14px; overflow:hidden; background: var(--sage-pale); box-shadow: 0 1px 6px var(--shadow-soft); cursor:pointer; }
.fiche-gallery-item img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.fiche-gallery-item .gallery-del { position:absolute; top:6px; right:6px; width:24px; height:24px; border-radius:50%; background:rgba(0,0,0,.55); color:#fff; border:none; font-size:.8rem; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.fiche-gallery-item .gallery-del:hover { background:#C0392B; }
.fiche-gallery-lightbox { position:fixed; inset:0; background:rgba(0,0,0,.85); display:flex; align-items:center; justify-content:center; z-index:2000; cursor:zoom-out; }
.fiche-gallery-lightbox img { max-width:90vw; max-height:90vh; border-radius:10px; }
.fiche-dropzone { border:2px dashed #ddd; border-radius:14px; padding:26px 16px; text-align:center; color: var(--text-light); font-size:.85rem; font-weight:700; cursor:pointer; margin-bottom:16px; transition: border-color .15s, background .15s; }
.fiche-dropzone:hover, .fiche-dropzone.drag-over { border-color: var(--sage); background: var(--sage-pale); color: var(--sage); }
.fiche-document-list { display:flex; flex-direction:column; gap:8px; }
.fiche-document-item { background: var(--white); border-radius: 14px; padding: 12px 16px; display:flex; align-items:center; gap:12px; box-shadow: 0 1px 6px var(--shadow-soft); }
.fiche-document-item .doc-icon { font-size:1.5rem; flex-shrink:0; }
.fiche-document-item .doc-info { flex-grow:1; min-width:0; }
.fiche-document-item .doc-info strong { display:block; font-size:.88rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fiche-document-item .doc-info span { font-size:.76rem; color: var(--text-light); }
.fiche-document-item .doc-actions { display:flex; gap:4px; flex-shrink:0; }
.fiche-name { text-align:center; font-family:'Fredoka One',cursive; font-size:1.25rem; margin:0; }
.fiche-meta { text-align:center; color: var(--text-light); font-size:.78rem; margin:3px 0; }
.fiche-comportement-label { text-align:center; font-weight:800; font-size:.78rem; color: var(--text-light); margin-top:16px; }
.fiche-comportement { display:flex; justify-content:center; gap:7px; margin:8px 0 16px; }
.paw-dot { width:20px; height:20px; border-radius:50%; background:#E2E2E2; cursor:pointer; border:none; padding:0; transition: background .15s; }
.paw-dot.active.lvl-1 { background: #D9C49E; }
.paw-dot.active.lvl-2 { background: #C2A178; }
.paw-dot.active.lvl-3 { background: #B08A5E; }
.paw-dot.active.lvl-4 { background: #8C5F32; }
.paw-dot.active.lvl-5 { background: #E13A3A; }
.fiche-comportement-scale { display:flex; justify-content:space-between; max-width:190px; margin:0 auto; font-size:.62rem; font-weight:700; color: var(--text-light); }
.fiche-field-block label { display:block; font-size:.78rem; font-weight:800; margin-bottom:5px; color: var(--text-light); }
.fiche-field-block textarea { width:100%; min-height:64px; resize:vertical; border-radius:10px; border:1px solid #ddd; padding:9px 12px; font-family:'Nunito',sans-serif; font-size:.84rem; }
.fiche-btn-row { display:flex; gap:6px; margin-top:16px; }
.fiche-btn-row button { flex:1; padding:9px 4px; border-radius:10px; border:none; font-size:.7rem; font-weight:800; cursor:pointer; }
.fb-fusion { background: var(--sage-pale); color: var(--sage); }
.fb-dup { background:#3A3A3A; color:#fff; }
.fb-arch { background: var(--terracotta); color:#fff; }
.fiche-qr-btn { width:100%; margin-top:8px; background: var(--sage); color:#fff; border:none; border-radius:10px; padding:10px; font-weight:800; font-size:.82rem; cursor:pointer; }
.fiche-owner { display:flex; align-items:center; gap:10px; margin-top:18px; padding-top:16px; border-top:1px solid #eee; cursor:pointer; }
.fiche-owner:hover .client-name { color: var(--sage); }
.fiche-owner-assignment { position:relative; margin-top:12px; padding:12px; border:1px solid var(--sage-pale); border-radius:12px; background:linear-gradient(135deg, var(--sage-pale), #fff); }
.fiche-owner-assignment > label { display:block; margin-bottom:7px; font-size:.76rem; font-weight:900; color:var(--sage); }
.fiche-owner-select-wrap { display:flex; align-items:center; padding:0 9px; border:1px solid #d8e5da; border-radius:9px; background:#fff; }
.fiche-owner-select-wrap input { width:100%; min-width:0; padding:9px 0; border:0; outline:0; background:transparent; color:var(--text); font-family:'Nunito',sans-serif; font-size:.82rem; font-weight:700; }
.fiche-owner-select-wrap select { display:none; }
.fiche-owner-results { display:none; position:absolute; z-index:30; top:76px; left:12px; right:12px; max-height:220px; overflow-y:auto; background:#fff; border:1px solid #d8e5da; border-radius:10px; box-shadow:0 8px 20px rgba(42,57,43,.16); }
.fiche-owner-results.show { display:block; }
.fiche-owner-results button { display:block; width:100%; padding:10px 12px; border:0; border-bottom:1px solid #eef3ee; background:#fff; text-align:left; color:var(--text); font:700 .78rem 'Nunito',sans-serif; cursor:pointer; }
.fiche-owner-results button:last-child { border-bottom:0; }
.fiche-owner-results button:hover { background:var(--sage-pale); color:var(--sage); }
.fiche-owner-help { display:block; margin-top:7px; color:var(--text-light); font-size:.67rem; line-height:1.3; }

.fiche-right { flex-grow:1; min-width:0; background: var(--white); border-radius: var(--r-card); box-shadow: 0 2px 12px var(--shadow-soft); overflow:hidden; }
.fiche-tabs { display:flex; background: var(--sage); overflow-x:auto; }
.fiche-tab { padding:14px 16px; color:#fff; font-weight:800; font-size:.8rem; cursor:pointer; white-space:nowrap; opacity:.72; border-bottom:3px solid transparent; flex-shrink:0; }
.fiche-tab:hover { opacity:.95; }
.fiche-tab.active { opacity:1; border-color:#fff; }
.fiche-tab .tab-badge { background:#fff; color: var(--sage); font-size:.65rem; font-weight:900; border-radius:10px; padding:1px 6px; margin-left:4px; }
.fiche-body { padding:24px 26px; }
.fiche-section-title { font-family:'Fredoka One',cursive; font-size:1.02rem; margin:0 0 14px; display:flex; justify-content:space-between; align-items:center; }
.fiche-section-title:not(:first-child) { margin-top:26px; }
.fiche-add-btn { background:none; border:1px solid #ddd; border-radius:8px; width:28px; height:28px; cursor:pointer; color: var(--text-light); font-weight:900; }
.fiche-add-btn:hover { color: var(--sage); border-color: var(--sage); }
.fiche-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }
.fc-grid-2 { display:grid; grid-template-columns:repeat(2, 1fr); gap:14px; margin-top:14px; }
.fc-grid-3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-top:14px; }
.fc-grid-5 { display:grid; grid-template-columns:repeat(5, 1fr); gap:14px; }
.fc-quick-btn { width:100%; background:var(--white); border:1px solid #ddd; border-radius:12px; padding:11px; font-weight:800; font-size:.82rem; cursor:pointer; margin-top:8px; color:var(--text); }
.fc-quick-btn:hover { border-color:var(--sage); color:var(--sage); }
@media (max-width: 900px) { .fc-grid-5 { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 480px) { .fc-grid-5, .fc-grid-3, .fc-grid-2 { grid-template-columns:1fr; } }
.fiche-field label { display:block; font-size:.74rem; font-weight:800; color: var(--text-light); margin-bottom:5px; }
.fiche-field input, .fiche-field select { width:100%; padding:9px 11px; border-radius:9px; border:1px solid #ddd; font-family:'Nunito',sans-serif; font-size:.83rem; }
.fiche-field-clear { display:flex; gap:5px; }
.fiche-field-clear input { flex-grow:1; }
.fiche-field-clear button { background:#FCE3E3; color:#C0392B; border:none; border-radius:8px; width:30px; cursor:pointer; font-weight:900; flex-shrink:0; }
.fiche-field-add { display:flex; gap:5px; }
.fiche-field-add input { flex-grow:1; }
.fiche-field-add button { background: var(--sage); color:#fff; border:none; border-radius:9px; width:32px; cursor:pointer; font-weight:900; flex-shrink:0; }
.fiche-placeholder { padding:60px 20px; text-align:center; color: var(--text-light); font-size:.9rem; }

/* NOTES JOURNAL */
.notes-add-box { margin-bottom:22px; }
.notes-add-box textarea { width:100%; min-height:76px; resize:vertical; border-radius:12px; border:1px solid #ddd; padding:12px 14px; font-family:'Nunito',sans-serif; font-size:.88rem; margin-bottom:10px; }
.notes-add-row { display:flex; justify-content:flex-end; align-items:center; gap:10px; flex-wrap:wrap; }
.notes-add-row input { flex:1; min-width:150px; max-width:220px; padding:9px 12px; border-radius:9px; border:1px solid #ddd; font-family:'Nunito',sans-serif; font-size:.82rem; }
.btn-notes-add { background: var(--sage); color:#fff; border:none; border-radius:10px; padding:11px 18px; font-weight:800; font-size:.85rem; cursor:pointer; flex-shrink:0; white-space:nowrap; }
.btn-notes-add:hover { background: var(--sage-dark); }
.notes-journal { display:flex; flex-direction:column; gap:18px; }
.note-item-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.note-avatar { width:34px; height:34px; border-radius:50%; background: var(--sage-pale); display:flex; align-items:center; justify-content:center; font-size:1rem; flex-shrink:0; }
.note-meta { flex-grow:1; font-size:.82rem; color: var(--text-light); }
.note-meta b { color: var(--sage); font-weight:800; }
.note-actions { display:flex; gap:12px; flex-shrink:0; }
.note-actions button { background:none; border:none; cursor:pointer; font-size:.92rem; color: var(--text-light); padding:2px; }
.note-actions button.note-edit:hover { color: var(--sage); }
.note-actions button.note-del:hover { color:#C0392B; }
.note-content { background: var(--cream); border-radius:12px; padding:12px 14px; font-size:.86rem; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.fiche-save-fab { position:fixed; right:28px; bottom:28px; width:54px; height:54px; border-radius:50%; background: var(--sage); color:#fff; border:none; font-size:1.25rem; cursor:pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); z-index:50; }
.fiche-save-fab:hover { background: var(--sage-dark); }

@media (max-width: 860px) {
  .fiche-wrap { flex-direction:column; }
  .fiche-left { width:100%; }
  .fiche-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .fiche-grid { grid-template-columns: 1fr; }
}

/* MODALES SPÉCIFIQUES */
.modal-box-animal { padding:0; overflow:hidden; display:flex; flex-direction:column; max-height:86vh; }
.modal-header-bar {
  background: linear-gradient(135deg, var(--sage), var(--sage-light));
  color:#fff; padding:18px 24px; display:flex;
  align-items:center; justify-content:space-between; flex-shrink:0;
}
.modal-header-title { font-family:'Fredoka One',cursive; font-size:1.15rem; }
.modal-header-close { background:none; border:none; color:#fff; font-size:1.3rem; cursor:pointer; line-height:1; }
.modal-header-close:hover { opacity:.8; }
.modal-body-scroll { padding:24px; overflow-y:auto; flex-grow:1; }
.modal-footer-bar { padding:16px 24px 22px; border-top:1px solid #eee; flex-shrink:0; }
.modal-submit-full { margin-top:0; }

/* ===== DETAIL RDV (POPUP AU CLIC) ===== */
.rdvd-box {
  max-width: 600px;
  width: 92%;
  padding: 0;
  overflow: visible;
  border-radius: 24px;
}

.rdvd-header {
  background: var(--sage);
  color: #fff;
  padding: 20px 22px 16px;
  position: relative;
  border-radius: 24px 24px 0 0;
}

.rdvd-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rdvd-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
}

.rdvd-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.rdvd-icon-btn {
  display: flex;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: .9;
  padding: 4px;
}

.rdvd-icon-btn:hover {
  opacity: 1;
}

.rdvd-datetime-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  opacity: .9;
  margin-top: 6px;
}

.rdvd-menu {
  position: absolute;
  top: 50px;
  right: 60px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
  overflow: hidden;
  z-index: 20;
  display: none;
  min-width: 210px;
}

.rdvd-menu.show {
  display: block;
}

.rdvd-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 13px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.rdvd-menu button:hover {
  background: var(--cream);
}

.rdvd-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.rdvd-tab {
  flex: 1;
  text-align: center;
  padding: 15px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.rdvd-tab.active {
  color: var(--text);
  border-color: var(--text);
}

.rdvd-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rdvd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.rdvd-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sage-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.rdvd-avatar-orange {
  background: #FFE3C2;
}

.rdvd-link {
  color: var(--terracotta);
  font-weight: 800;
  cursor: pointer;
}

.rdvd-link:hover {
  text-decoration: underline;
}

.rdvd-card {
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 14px 16px;
}

.rdvd-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.rdvd-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--sage);
  color: #fff;
  letter-spacing: .3px;
}

.rdvd-badge.termine { background: #9AA39D; }
.rdvd-badge.annule { background: #C0392B; }
.rdvd-badge.absent { background: #D9A441; }

.rdvd-footer {
  display: flex;
  gap: 10px;
  padding: 18px 24px 22px;
}

.rdvd-btn {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rdvd-btn-menu { background: var(--terracotta); flex: 0 0 60px; }
.rdvd-btn-modifier { background: var(--sage-dark); flex: 1; }
.rdvd-btn-debut { background: #7E6749; flex: 1; }

/* ===== MODE SOMBRE ===== */
body.dark-mode {
  --cream: #1B1F1D;
  --white: #262B28;
  --text: #EDEFEC;
  --text-light: #9AA39D;
  --shadow-soft: rgba(0,0,0,0.35);
  --sage-pale: #2E3B32;
}
body.dark-mode .sidebar { background: var(--white); border-color:#333; }
body.dark-mode .modal-box, body.dark-mode .postsave-box, body.dark-mode .login-box { background: var(--white); }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
  background:#1F2422; color: var(--text); border-color:#3A403C;
}
body.dark-mode thead th { background:#20241F; }
body.dark-mode tbody tr:hover { background:#20241F; }
body.dark-mode .cal-day, body.dark-mode .week-card, body.dark-mode .table-card,
body.dark-mode .filters-card, body.dark-mode .cat-card, body.dark-mode .fiche-left,
body.dark-mode .fiche-right, body.dark-mode .rdv-item, body.dark-mode .produit-card,
body.dark-mode .demande-card, body.dark-mode .tache-card, body.dark-mode .global-search-results {
  background: var(--white);
}
body.dark-mode .week-daycol { background-image: repeating-linear-gradient(to bottom, #2A2F2C 0, #2A2F2C 1px, transparent 1px, transparent var(--hour-h)), repeating-linear-gradient(to bottom, #232724 0, #232724 1px, transparent 1px, transparent var(--half-hour-h)); }
body.dark-mode .note-content { background:#1F2422; }
body.dark-mode .fidelite-box { background:#1F2422; }
body.dark-mode .rdvd-card { border-color: #3A403C; }
body.dark-mode .rdvd-menu { background: var(--white); color: var(--text); }
body.dark-mode .rdvd-menu button { color: var(--text); }
body.dark-mode .rdvd-menu button:hover { background: #1F2422; }
