/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════ */
:root {
  --bg:       #EFF5EF;
  --bg1:      #E6F0E6;
  --bg2:      #FFFFFF;
  --bg3:      #EAF3EA;
  --bg4:      #D5EAD9;
  --card:     #FFFFFF;
  --border:   #CBE0CC;
  --border2:  #A6CDA8;
  --gold:     #00853F;
  --gold-lt:  #00A651;
  --gold-xlt: #2FBF6B;
  --gold-dim: #006B33;
  --cream:    #0B1F12;
  --sand:     #1B3A26;
  --sand-lt:  #2A4F37;
  --sand-dim: #527A60;
  --muted:    #8AA892;
  --green:    #00853F;
  --red:      #E31B23;
  --blue:     #006B33;
  --r:        14px;
  --fd: 'Cormorant Garamond', Georgia, serif;
  --fb: 'DM Sans', 'Helvetica Neue', sans-serif;
  --sh-card:  0 4px 24px rgba(0,0,0,.08);
  --sh-float: 0 12px 48px rgba(0,0,0,.14);
  --sh-modal: 0 24px 80px rgba(0,0,0,.22);
  --sh-gold:  0 8px 32px rgba(0,133,63,.32);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--fb);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#app { min-height: 100vh; }
button  { font-family: var(--fb); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--fb); font-size: 14px; outline: none; border: none; background: none; width: 100%; color: var(--cream); }
input::placeholder, textarea::placeholder { color: var(--muted); }
a { color: var(--gold-lt); text-decoration: none; }
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ═══════════════════════════════════════════════════════
   CSS3 ANIMATIONS / KEYFRAMES
═══════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.04); opacity: .85; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes barGrow {
  from { width: 0; }
}
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

/* ── Animation utility classes ── */
.anim-fade    { animation: fadeIn .35s ease both; }
.anim-up      { animation: slideUp .4s cubic-bezier(.16,1,.3,1) both; }
.anim-down    { animation: slideDown .3s cubic-bezier(.16,1,.3,1) both; }
.anim-scale   { animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both; }

.anim-up:nth-child(1)  { animation-delay: .04s; }
.anim-up:nth-child(2)  { animation-delay: .08s; }
.anim-up:nth-child(3)  { animation-delay: .12s; }
.anim-up:nth-child(4)  { animation-delay: .16s; }
.anim-up:nth-child(5)  { animation-delay: .20s; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .55s linear infinite;
}

/* Loading dots */
.dots { display: flex; gap: 4px; align-items: center; }
.dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: dotBounce 1.2s ease infinite;
}
.dots span:nth-child(2) { animation-delay: .16s; }
.dots span:nth-child(3) { animation-delay: .32s; }

/* ═══════════════════════════════════════════════════════
   AUTH SCREENS
═══════════════════════════════════════════════════════ */
.auth-wrap {
  display: flex;
  height: 100vh;
  overflow: hidden;
  animation: fadeIn .4s ease both;
}

/* Hero panel */
.auth-hero {
  width: 44%; min-width: 320px;
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 44px 40px;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.auth-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(0,133,63,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 90%, rgba(0,133,63,.04) 0%, transparent 55%);
  pointer-events: none;
}
.auth-hero-decor {
  position: absolute;
  top: -5%; right: -8%;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,133,63,.15);
  animation: float 6s ease-in-out infinite;
}
.auth-hero-decor::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px solid rgba(0,133,63,.07);
}

.auth-logo {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
  animation: slideDown .5s cubic-bezier(.16,1,.3,1) both;
}
.auth-logo-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  box-shadow: var(--sh-gold);
  transition: transform .3s ease;
}
.auth-logo-icon:hover { transform: rotate(-5deg) scale(1.08); }
.auth-logo-name  { font-family: var(--fd); font-size: 20px; font-weight: 700; color: var(--gold-lt); letter-spacing: .4px; }
.auth-logo-sub   { font-size: 9px; color: var(--muted); letter-spacing: 2.8px; text-transform: uppercase; margin-top: 2px; }

.auth-hero-content {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; padding-bottom: 24px;
  position: relative; z-index: 1;
}
.auth-hero-title {
  font-family: var(--fd); font-size: 46px; font-weight: 700;
  color: var(--cream); line-height: 1.08; margin-bottom: 16px;
  animation: slideUp .6s cubic-bezier(.16,1,.3,1) .1s both;
}
.auth-hero-title span { color: var(--gold-lt); }
.auth-hero-desc {
  font-size: 13px; color: var(--sand-dim); line-height: 1.85;
  margin-bottom: 28px;
  animation: slideUp .6s cubic-bezier(.16,1,.3,1) .18s both;
}

.auth-feat {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  animation: slideUp .6s cubic-bezier(.16,1,.3,1) both;
}
.auth-feat:nth-child(1) { animation-delay: .24s; }
.auth-feat:nth-child(2) { animation-delay: .30s; }
.auth-feat:nth-child(3) { animation-delay: .36s; }
.auth-feat:nth-child(4) { animation-delay: .42s; }
.auth-feat-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(0,133,63,.1);
  border: 1px solid rgba(0,133,63,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  transition: transform .25s ease, background .25s ease;
}
.auth-feat:hover .auth-feat-icon { transform: scale(1.15); background: rgba(0,133,63,.18); }
.auth-feat-text { font-size: 13px; color: var(--sand); transition: color .2s; }
.auth-feat:hover .auth-feat-text { color: var(--gold); }

.auth-footer {
  font-size: 10px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 1px; position: relative; z-index: 1;
  animation: fadeIn .8s ease .5s both;
}

/* Form panel */
.auth-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; overflow-y: auto;
}
.auth-form-wrap {
  width: 100%; max-width: 440px;
  animation: slideUp .5s cubic-bezier(.16,1,.3,1) .1s both;
}

.auth-card {
  background: var(--bg2);
  border-radius: 22px;
  padding: 32px 30px;
  box-shadow: var(--sh-float);
  border: 1px solid var(--border2);
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt), var(--gold-xlt), var(--gold));
  background-size: 200% 100%;
  animation: gradShift 3s ease infinite;
}

.auth-card-title { font-family: var(--fd); font-size: 28px; color: var(--gold-lt); font-weight: 700; line-height: 1; margin-bottom: 6px; }
.auth-card-sub   { font-size: 12px; color: var(--sand-dim); margin-bottom: 24px; }

/* Field */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--sand-dim); margin-bottom: 7px;
  transition: color .2s;
}
.field-input {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex; align-items: center; gap: 8px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field-input:focus-within {
  border-color: var(--gold-lt);
  box-shadow: 0 0 0 3px rgba(0,133,63,.1);
  background: var(--bg2);
}
.field:focus-within label { color: var(--gold-lt); }
.eye-btn {
  color: var(--muted); font-size: 15px; flex-shrink: 0;
  transition: color .2s, transform .2s;
  padding: 2px;
}
.eye-btn:hover { color: var(--sand); transform: scale(1.15); }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 60%, var(--gold-xlt) 100%);
  background-size: 200% 200%;
  color: #fff; border-radius: 12px;
  padding: 14px 24px; font-size: 14px; font-weight: 700;
  width: 100%; text-align: center;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(0,133,63,.35);
  letter-spacing: .3px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover  { opacity: .92; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,133,63,.4); }
.btn-primary:active { transform: translateY(0); opacity: 1; }

.btn-ghost { font-size: 12px; font-weight: 700; color: var(--gold-lt); transition: color .2s; }
.btn-ghost:hover { color: var(--gold); text-decoration: underline; }

.auth-link-row { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* Demo cards */
.demo-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
  text-align: center; margin: 18px 0 10px;
}
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.demo-card:hover {
  border-color: var(--gold-lt);
  background: rgba(0,133,63,.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,133,63,.1);
}
.demo-card:active { transform: translateY(0); }
.demo-avatar  { font-size: 22px; }
.demo-name    { font-size: 12px; font-weight: 700; color: var(--cream); }
.demo-role    { font-size: 10px; color: var(--gold-lt); margin-top: 1px; }

/* Role chips */
.role-row { display: flex; gap: 8px; }
.role-chip {
  flex: 1; padding: 10px 8px; border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg3);
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
}
.role-chip:hover { border-color: rgba(0,133,63,.4); transform: translateY(-1px); }
.role-chip.active {
  border-color: var(--gold-lt);
  background: rgba(0,133,63,.1);
  box-shadow: 0 2px 12px rgba(0,133,63,.15);
}
.role-chip-label { font-size: 12px; font-weight: 700; color: var(--cream); transition: color .2s; }
.role-chip.active .role-chip-label { color: var(--gold-lt); }
.role-chip-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Error / Success */
.err-box {
  background: rgba(170,16,24,.07);
  border: 1px solid rgba(170,16,24,.22);
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--red);
  margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 8px;
  animation: slideDown .3s cubic-bezier(.16,1,.3,1) both;
}

/* Auth footer */
.auth-page-footer {
  margin-top: 14px; text-align: center;
  font-size: 10px; color: var(--muted);
}

/* ═══════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════ */
.app-shell {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  animation: fadeIn .3s ease both;
}

/* Top bar */
.topbar {
  height: 62px;
  background: rgba(255,253,249,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 22px; gap: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  position: relative; z-index: 10;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; margin-right: 24px; }
.topbar-logo-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 16px rgba(0,133,63,.28);
  transition: transform .3s ease;
}
.topbar-logo-icon:hover { transform: rotate(-8deg) scale(1.08); }
.topbar-logo-name { font-family: var(--fd); font-size: 17px; font-weight: 700; color: var(--gold-lt); }

.topbar-tabs { display: flex; gap: 2px; flex: 1; }
.topbar-tab {
  padding: 7px 15px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--sand-dim);
  transition: color .2s, background .2s;
  position: relative;
}
.topbar-tab::after {
  content: '';
  position: absolute; bottom: 2px; left: 50%; right: 50%;
  height: 2px; border-radius: 99px;
  background: var(--gold-lt);
  transition: left .2s cubic-bezier(.16,1,.3,1), right .2s cubic-bezier(.16,1,.3,1), opacity .2s;
  opacity: 0;
}
.topbar-tab:hover { color: var(--gold); background: rgba(0,133,63,.06); }
.topbar-tab.active {
  color: var(--gold);
  background: rgba(0,133,63,.1);
}
.topbar-tab.active::after { left: 20%; right: 20%; opacity: 1; }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.notif-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background .2s, transform .2s;
  position: relative;
}
.notif-btn:hover { background: var(--bg4); transform: scale(1.08); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg2);
  animation: pulse 2s ease infinite;
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 11px; padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.user-chip:hover { border-color: var(--gold-lt); background: rgba(0,133,63,.06); box-shadow: 0 2px 12px rgba(0,133,63,.1); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 8px rgba(0,133,63,.3);
}
.user-name { font-size: 12px; font-weight: 700; color: var(--sand); }

/* App content */
.app-content { flex: 1; overflow-y: auto; padding: 26px 28px; }

/* ═══════════════════════════════════════════════════════
   LAYOUT HELPERS
═══════════════════════════════════════════════════════ */
.page-header   { margin-bottom: 24px; }
.page-title    { font-family: var(--fd); font-size: 32px; font-weight: 700; color: var(--cream); margin-bottom: 3px; }
.page-sub      { font-size: 13px; color: var(--sand-dim); }

.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.g2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 22px; }
.card   { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: box-shadow .2s; }
.card:hover { box-shadow: var(--sh-card); }
.card-lg { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 20px; transition: box-shadow .2s; }
.card-lg:hover { box-shadow: var(--sh-card); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  transition: opacity .2s;
}
.badge-gold  { background: rgba(0,133,63,.12); color: var(--gold-lt); }
.badge-green { background: rgba(0,98,46,.1);   color: var(--green); }
.badge-red   { background: rgba(170,16,24,.1); color: var(--red); }
.badge-muted { background: var(--bg3); color: var(--sand-dim); }
.badge-palm  { background: rgba(0,133,63,.12); color: #00A651; }

/* Section header */
.sec-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sec-title { font-size: 14px; font-weight: 800; color: var(--cream); }

/* Add button */
.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 12px; font-weight: 700;
  box-shadow: 0 3px 14px rgba(0,133,63,.3);
  transition: opacity .2s, transform .2s, box-shadow .2s;
  flex-shrink: 0;
}
.btn-add:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,133,63,.35); }
.btn-add:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════════════════════ */
.kpi {
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 4px; height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--kpi-color, var(--gold-lt));
  opacity: .7;
}
.kpi-icon {
  font-size: 22px; margin-bottom: 8px;
  display: inline-block;
  transition: transform .3s ease;
}
.kpi:hover .kpi-icon { transform: scale(1.2) rotate(-5deg); }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--sand-dim); margin-bottom: 6px; }
.kpi-value { font-family: var(--fd); font-size: 36px; font-weight: 700; color: var(--cream); line-height: 1; margin-bottom: 4px; }
.kpi-sub   { font-size: 11px; color: var(--muted); }
.kpi-bar   { height: 3px; border-radius: 99px; margin-top: 14px; background: var(--bg4); overflow: hidden; }
.kpi-bar-fill {
  height: 100%; border-radius: 99px;
  animation: barGrow .8s cubic-bezier(.16,1,.3,1) .2s both;
}

/* ═══════════════════════════════════════════════════════
   TROUPEAU
═══════════════════════════════════════════════════════ */
.toolbar {
  display: flex; gap: 10px; margin-bottom: 18px;
  flex-wrap: wrap; align-items: center;
}
.search-wrap {
  flex: 1; min-width: 180px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 9px 14px;
  display: flex; align-items: center; gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap:focus-within { border-color: var(--gold-lt); box-shadow: 0 0 0 3px rgba(0,133,63,.08); }
.search-wrap input { font-size: 13px; }
.search-icon { font-size: 14px; flex-shrink: 0; }

.filter-chip {
  padding: 7px 13px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg2); font-size: 12px; font-weight: 600;
  color: var(--sand-dim);
  transition: all .2s;
}
.filter-chip:hover { border-color: var(--gold-lt); color: var(--gold); transform: translateY(-1px); }
.filter-chip.active {
  background: rgba(0,133,63,.1);
  border-color: var(--gold-lt); color: var(--gold-lt);
  box-shadow: 0 2px 10px rgba(0,133,63,.12);
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.animal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .25s, transform .2s;
  animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both;
}
.animal-card:hover {
  border-color: var(--gold-lt);
  box-shadow: 0 6px 24px rgba(0,133,63,.12);
  transform: translateY(-3px);
}
.animal-card:active { transform: translateY(-1px); }
.a-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.a-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(0,133,63,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background .2s, transform .2s;
}
.animal-card:hover .a-icon { background: rgba(0,133,63,.16); transform: rotate(-5deg) scale(1.08); }
.a-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.a-name   { font-size: 14px; font-weight: 800; color: var(--cream); margin-bottom: 3px; }
.a-race   { font-size: 11px; color: var(--sand-dim); margin-bottom: 10px; }
.a-stats  { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.a-stat   {
  background: var(--bg3); border-radius: 8px; padding: 7px 9px;
  transition: background .2s;
}
.animal-card:hover .a-stat { background: var(--bg4); }
.a-stat-val { font-size: 13px; font-weight: 700; color: var(--cream); }
.a-stat-lbl { font-size: 10px; color: var(--muted); }

/* Empty state */
.empty-state {
  grid-column: 1 / -1; text-align: center;
  padding: 56px 24px; color: var(--muted);
  animation: fadeIn .4s ease both;
}
.empty-state-icon { font-size: 48px; margin-bottom: 14px; opacity: .5; animation: float 4s ease-in-out infinite; }
.empty-state-text { font-size: 14px; }

/* ═══════════════════════════════════════════════════════
   SANTÉ
═══════════════════════════════════════════════════════ */
.soin-list { display: flex; flex-direction: column; gap: 10px; }
.soin-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  animation: slideUp .35s cubic-bezier(.16,1,.3,1) both;
}
.soin-item:hover { border-color: var(--border2); transform: translateX(3px); box-shadow: var(--sh-card); }
.soin-badge {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: transform .2s;
}
.soin-item:hover .soin-badge { transform: scale(1.12) rotate(-5deg); }
.soin-info    { flex: 1; min-width: 0; }
.soin-title   { font-size: 13px; font-weight: 700; color: var(--cream); }
.soin-meta    { font-size: 11px; color: var(--sand-dim); margin-top: 2px; }
.soin-suivi   { font-size: 11px; color: var(--green); margin-top: 3px; }
.soin-right   { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.soin-cost    { font-size: 12px; font-weight: 700; color: var(--gold-lt); }

/* ═══════════════════════════════════════════════════════
   RÉSEAU
═══════════════════════════════════════════════════════ */
.reseau-wrap { max-width: 680px; margin: 0 auto; }

.composer {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px; margin-bottom: 18px;
  transition: box-shadow .2s;
}
.composer:focus-within { box-shadow: 0 4px 24px rgba(0,133,63,.1); border-color: rgba(0,133,63,.25); }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  flex-shrink: 0; box-shadow: var(--sh-gold);
}
.composer-input {
  flex: 1; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 14px; resize: none;
  min-height: 80px; font-size: 13px; color: var(--cream);
  transition: border-color .2s, box-shadow .2s;
}
.composer-input:focus { border-color: var(--gold-lt); box-shadow: 0 0 0 3px rgba(0,133,63,.08); outline: none; }
.composer-footer { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-post {
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: #fff; border-radius: 9px; padding: 9px 20px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 3px 14px rgba(0,133,63,.3);
  transition: opacity .2s, transform .2s;
}
.btn-post:hover { opacity: .9; transform: translateY(-2px); }
.btn-post:active { transform: translateY(0); }

.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px;
  transition: box-shadow .2s, border-color .2s;
  animation: slideUp .35s cubic-bezier(.16,1,.3,1) both;
}
.post-item:hover { box-shadow: var(--sh-card); border-color: var(--border2); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  transition: transform .2s;
}
.post-item:hover .post-avatar { transform: scale(1.06); }
.post-author { font-size: 13px; font-weight: 700; color: var(--cream); }
.post-role   { font-size: 11px; color: var(--gold-lt); }
.post-date   { font-size: 11px; color: var(--muted); margin-left: auto; }
.post-text   { font-size: 14px; color: var(--sand); line-height: 1.72; margin-bottom: 12px; }
.post-tags   { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.post-tag {
  background: rgba(0,133,63,.08); color: var(--gold-lt);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  transition: background .2s;
}
.post-tag:hover { background: rgba(0,133,63,.15); }
.post-actions {
  display: flex; align-items: center; gap: 18px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.post-like {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--sand-dim);
  transition: color .2s, transform .15s;
}
.post-like:hover { color: var(--red); transform: scale(1.06); }
.post-like.liked { color: var(--red); }
.post-like .heart { transition: transform .2s; display: inline-block; }
.post-like:active .heart { transform: scale(1.4); }

/* ═══════════════════════════════════════════════════════
   PROFIL
═══════════════════════════════════════════════════════ */
.profil-wrap { max-width: 700px; margin: 0 auto; }
.profil-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 32px 28px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 20px; position: relative; overflow: hidden;
  transition: box-shadow .2s;
}
.profil-hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt), var(--gold-xlt));
  background-size: 200%;
  animation: gradShift 4s ease infinite;
}
.profil-hero:hover { box-shadow: var(--sh-card); }
.profil-av-lg {
  width: 76px; height: 76px; border-radius: 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt), var(--gold-xlt));
  background-size: 200% 200%;
  animation: gradShift 5s ease infinite;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: #fff;
  flex-shrink: 0; box-shadow: var(--sh-gold);
  transition: transform .3s;
}
.profil-hero:hover .profil-av-lg { transform: scale(1.06) rotate(-3deg); }
.profil-name  { font-family: var(--fd); font-size: 28px; font-weight: 700; color: var(--cream); margin-bottom: 4px; }
.profil-sub   { font-size: 13px; color: var(--sand-dim); margin-bottom: 10px; }

.profil-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.profil-stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.profil-stat:hover { transform: translateY(-3px); box-shadow: var(--sh-card); }
.profil-stat-val { font-family: var(--fd); font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1; }
.profil-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 5px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-box {
  background: var(--bg3); border-radius: 11px; padding: 12px 14px;
  transition: background .2s;
}
.info-box:hover { background: var(--bg4); }
.info-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.info-val { font-size: 14px; font-weight: 600; color: var(--cream); }

.settings-list { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.settings-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  transition: background .2s, transform .15s; cursor: pointer;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg3); }
.settings-item:active { transform: translateX(4px); }
.s-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  transition: transform .2s;
}
.settings-item:hover .s-icon { transform: scale(1.15); }
.s-lbl { font-size: 13px; font-weight: 700; color: var(--cream); }
.s-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.s-arrow { margin-left: auto; font-size: 16px; color: var(--muted); transition: transform .2s; }
.settings-item:hover .s-arrow { transform: translateX(3px); color: var(--gold-lt); }

.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(170,16,24,.06);
  border: 1.5px solid rgba(170,16,24,.18);
  color: var(--red); border-radius: 14px;
  padding: 14px; font-size: 13px; font-weight: 700;
  width: 100%;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-logout:hover { background: rgba(170,16,24,.12); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(170,16,24,.1); }
.btn-logout:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,22,16,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  animation: fadeIn .2s ease both;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 24px; padding: 28px;
  width: 100%; max-width: 500px;
  box-shadow: var(--sh-modal);
  max-height: 90vh; overflow-y: auto;
  animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both;
  position: relative;
}
.modal-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: 24px 24px 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt), var(--gold-xlt));
  background-size: 200%;
  animation: gradShift 3s ease infinite;
}
.modal-title { font-family: var(--fd); font-size: 22px; font-weight: 700; color: var(--gold-lt); margin-bottom: 5px; }
.modal-sub   { font-size: 12px; color: var(--sand-dim); margin-bottom: 22px; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; }
.modal-footer button { flex: 1; }
.btn-cancel {
  background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--sand-dim); border-radius: 11px; padding: 12px;
  font-size: 13px; font-weight: 600;
  transition: background .2s, border-color .2s;
}
.btn-cancel:hover { background: var(--bg4); border-color: var(--border2); }
.btn-danger {
  background: var(--red); color: #fff;
  border-radius: 11px; padding: 12px;
  font-size: 13px; font-weight: 700;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 16px rgba(170,16,24,.3);
}
.btn-danger:hover { opacity: .9; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   DASHBOARD EXTRAS
═══════════════════════════════════════════════════════ */
.animal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg3);
  border-radius: 12px; margin-bottom: 8px;
  transition: background .2s, transform .15s;
  cursor: pointer;
}
.animal-row:hover { background: var(--bg4); transform: translateX(4px); }
.animal-row-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(0,133,63,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: transform .2s;
}
.animal-row:hover .animal-row-icon { transform: scale(1.1) rotate(-5deg); }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 14px;
  transition: border-color .2s, transform .15s;
  animation: slideUp .4s cubic-bezier(.16,1,.3,1) both;
}
.alert-item:hover { border-color: var(--border2); transform: translateX(3px); }
.alert-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
  animation: pulse 3s ease infinite;
}

/* ═══════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════════════════════ */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,253,249,.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.mobile-tabs { display: flex; }
.mobile-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 8px 4px 12px; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--sand-dim);
  cursor: pointer; transition: color .2s;
  position: relative;
}
.mobile-tab.active { color: var(--gold); }
.mobile-tab::before {
  content: '';
  position: absolute; top: 0; left: 30%; right: 30%;
  height: 2px; border-radius: 0 0 4px 4px;
  background: var(--gold-lt); opacity: 0;
  transition: opacity .2s;
}
.mobile-tab.active::before { opacity: 1; }
.mobile-tab-icon { font-size: 21px; transition: transform .2s; }
.mobile-tab.active .mobile-tab-icon { transform: scale(1.12); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px)  {
  .g3 { grid-template-columns: repeat(2,1fr); }
  .topbar-tabs { display: none; }
  .mobile-nav { display: block; }
  .app-content { padding-bottom: 72px; }
  .profil-stats { grid-template-columns: repeat(2,1fr); }
  .profil-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 640px)  {
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 24px 20px; }
  .app-content { padding: 16px 14px; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════ */
@keyframes toastIn  { from { opacity:0; transform:translateX(56px) scale(.94); } to { opacity:1; transform:none; } }
@keyframes toastOut { to   { opacity:0; transform:translateX(56px) scale(.9); } }

.toast-container {
  position: fixed; bottom: 28px; right: 24px;
  z-index: 500; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 14px;
  font-size: 13px; font-weight: 600; color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  min-width: 230px; max-width: 320px;
  animation: toastIn .35s cubic-bezier(.16,1,.3,1) both;
  pointer-events: all;
}
.toast.out    { animation: toastOut .22s ease both; }
.toast-icon   { font-size: 17px; flex-shrink: 0; }
.toast-success { background: linear-gradient(135deg, #00622E, #008840); }
.toast-error   { background: linear-gradient(135deg, #E31B23, #FF3B3B); }
.toast-info    { background: linear-gradient(135deg, var(--gold), var(--gold-lt)); }
.toast-warn    { background: linear-gradient(135deg, #006B33, #00A651); }
@media (max-width: 640px) { .toast-container { right: 12px; left: 12px; bottom: 80px; } .toast { min-width: unset; max-width: unset; } }

/* ═══════════════════════════════════════════════════════
   WELCOME BANNER
═══════════════════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(0,133,63,.05) 100%);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 22px 26px;
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt), var(--gold-xlt), var(--gold));
  background-size: 200%; animation: gradShift 3s ease infinite;
}
.welcome-av {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fff;
  flex-shrink: 0; box-shadow: var(--sh-gold);
}
.welcome-text  { flex: 1; min-width: 0; }
.welcome-greet { font-family: var(--fd); font-size: 22px; font-weight: 700; color: var(--cream); line-height: 1.1; }
.welcome-greet span { color: var(--gold-lt); }
.welcome-date  { font-size: 12px; color: var(--sand-dim); margin-top: 4px; }
.welcome-badge { display: flex; align-items: center; gap: 6px; }
.welcome-stat  {
  background: rgba(0,133,63,.08); border: 1px solid rgba(0,133,63,.15);
  border-radius: 10px; padding: 10px 16px; text-align: center; flex-shrink: 0;
}
.welcome-stat-val { font-family: var(--fd); font-size: 22px; font-weight: 700; color: var(--gold); line-height: 1; }
.welcome-stat-lbl { font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .welcome-stat { display: none; } }

/* ═══════════════════════════════════════════════════════
   QUICK ACTIONS
═══════════════════════════════════════════════════════ */
.quick-actions {
  display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap;
}
.qa-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: var(--sand);
  transition: all .2s; flex: 1; min-width: 150px;
}
.qa-btn:hover {
  border-color: var(--gold-lt); color: var(--gold);
  background: rgba(0,133,63,.05);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,133,63,.1);
}
.qa-btn:active { transform: translateY(0); }
.qa-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  transition: transform .2s;
}
.qa-btn:hover .qa-icon { transform: scale(1.15) rotate(-5deg); }

/* ═══════════════════════════════════════════════════════
   ASTUCE DU JOUR
═══════════════════════════════════════════════════════ */
.tip-card {
  background: linear-gradient(135deg, rgba(0,98,46,.06), rgba(0,98,46,.03));
  border: 1px solid rgba(0,98,46,.18);
  border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 22px;
}
.tip-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(0,98,46,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  animation: float 5s ease-in-out infinite;
}
.tip-label { font-size: 10px; text-transform: uppercase; letter-spacing: .9px; color: var(--green); font-weight: 700; margin-bottom: 4px; }
.tip-text  { font-size: 13px; color: var(--sand); line-height: 1.65; }

/* ═══════════════════════════════════════════════════════
   PASSWORD STRENGTH
═══════════════════════════════════════════════════════ */
.pwd-strength { margin-top: 8px; }
.pwd-strength-bar {
  height: 3px; border-radius: 99px;
  background: var(--border); overflow: hidden; margin-bottom: 4px;
}
.pwd-strength-fill { height: 100%; border-radius: 99px; transition: width .3s ease, background .3s ease; }
.pwd-strength-label { font-size: 10px; font-weight: 700; transition: color .3s; }

/* ═══════════════════════════════════════════════════════
   CHAR COUNTER
═══════════════════════════════════════════════════════ */
.char-count {
  font-size: 11px; color: var(--muted);
  text-align: right; margin-top: 6px;
  transition: color .2s;
}
.char-count.warn  { color: var(--gold-lt); }
.char-count.over  { color: var(--red); }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE WITH CTA
═══════════════════════════════════════════════════════ */
.empty-cta {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,133,63,.1); border: 1.5px solid rgba(0,133,63,.25);
  color: var(--gold); border-radius: 10px;
  padding: 9px 18px; font-size: 12px; font-weight: 700;
  transition: all .2s;
}
.empty-cta:hover { background: rgba(0,133,63,.18); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════
   SEARCH RESULTS COUNT
═══════════════════════════════════════════════════════ */
.results-count {
  font-size: 12px; color: var(--muted); margin-bottom: 14px;
  animation: fadeIn .2s ease both;
}
.results-count strong { color: var(--gold-lt); }

/* ═══════════════════════════════════════════════════════
   CONTENT TRANSITIONS
═══════════════════════════════════════════════════════ */
.tab-content { animation: tabFadeIn .3s cubic-bezier(.16,1,.3,1) both; }
@keyframes tabFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ═══════════════════════════════════════════════════════
   RIPPLE ON BUTTONS
═══════════════════════════════════════════════════════ */
.btn-primary { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: rippleAnim .5s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ═══════════════════════════════════════════════════════
   ANIMAL DETAIL MODAL
═══════════════════════════════════════════════════════ */
.modal-box-lg {
  max-width: 520px; padding: 0; overflow: hidden;
  max-height: 90vh; display: flex; flex-direction: column;
}

/* Tab bar */
.detail-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}
.detail-tab-btn {
  flex: 1; padding: 9px 10px; border-radius: 10px 10px 0 0;
  font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: transparent; border: none;
  transition: all .18s;
}
.detail-tab-btn.active {
  background: var(--gold-lt); color: #fff;
}
.detail-tab-btn:not(.active):hover {
  background: var(--bg3); color: var(--cream);
}
.detail-close {
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; font-weight: 700; color: var(--muted);
  background: var(--bg3); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; flex-shrink: 0; margin-left: 4px;
}
.detail-close:hover { background: rgba(170,16,24,.12); color: var(--red); }

/* Scrollable body */
.detail-body {
  overflow-y: auto; padding: 18px 18px 20px; flex: 1;
}

/* Hero section */
.di-hero {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.di-hero-icon  {
  font-size: 42px; flex-shrink: 0; position: relative;
  width: 76px; height: 76px; border-radius: 16px;
  background: rgba(0,133,63,.1);
  display: flex; align-items: center; justify-content: center;
}
.di-hero-icon .animal-photo-img { border-radius: 16px; }
.di-hero-photo-edit, .di-hero-photo-remove {
  position: absolute; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg3); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0;
  transition: transform .15s;
}
.di-hero-photo-edit {
  right: -6px; bottom: -6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt)); color: #fff;
}
.di-hero-photo-remove {
  right: -6px; top: -6px;
  background: #b23b3b; color: #fff;
}
.di-hero-photo-edit:hover, .di-hero-photo-remove:hover { transform: scale(1.14); }
.di-hero-name  { font-size: 20px; font-weight: 800; color: var(--cream); line-height: 1.2; }
.di-hero-meta  { font-size: 12px; color: var(--sand-dim); margin-top: 4px; }
.di-hero-mat   { font-family: ui-monospace, monospace; font-size: 12px; letter-spacing: .5px; color: var(--gold-lt); margin-top: 6px; font-weight: 700; }

/* Bouton carte d'identité */
.btn-id-card {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 16px; padding: 12px; border-radius: 12px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--gold-lt), var(--green));
  border: none; transition: transform .12s ease, box-shadow .12s ease;
}
.btn-id-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ── Carte d'identité virtuelle ── */
.idcard-modal { max-width: 480px; }
.idcard {
  background: linear-gradient(160deg, #00471F, #00853F);
  color: #fff; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.15); box-shadow: 0 12px 40px rgba(0,0,0,.3);
  margin-bottom: 16px;
}
.idcard-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: rgba(0,0,0,.18); border-bottom: 2px solid var(--gold-lt);
}
.idcard-emblem {
  font-size: 32px; width: 52px; height: 52px; flex: none; border-radius: 12px;
  background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* Photo d'animal — image clippée dans son conteneur */
.animal-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.a-icon, .animal-row-icon { overflow: hidden; }

/* Attache photo dans la modale d'ajout d'animal */
.animal-photo-attach { display: flex; align-items: center; gap: 12px; }
.animal-photo-thumb {
  width: 64px; height: 64px; border-radius: 12px; flex: none; overflow: hidden;
  background: rgba(0,133,63,.1); display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.animal-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.animal-photo-attach-actions { display: flex; flex-direction: column; gap: 6px; }
.btn-attach-photo, .btn-attach-photo-remove {
  border: 1px solid var(--border); background: var(--bg3); color: var(--cream);
  border-radius: 9px; padding: 8px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: filter .15s, transform .15s; text-align: left;
}
.btn-attach-photo:hover, .btn-attach-photo-remove:hover { filter: brightness(1.12); }
.btn-attach-photo-remove { color: #d98a8a; }
.idcard-org { font-weight: 800; letter-spacing: .5px; font-size: 16px; }
.idcard-doc { font-size: 11px; opacity: .85; margin-top: 2px; }
.idcard-main { display: flex; gap: 14px; padding: 18px; }
.idcard-left { flex: 1; min-width: 0; }
.idcard-name { font-size: 21px; font-weight: 800; line-height: 1.1; }
.idcard-mat {
  font-family: ui-monospace, monospace; font-size: 14px; color: #8FE0B0;
  margin: 4px 0 12px; letter-spacing: 1px; word-break: break-all;
}
.idcard-rows { display: flex; flex-direction: column; }
.idc-row {
  display: flex; justify-content: space-between; gap: 10px; font-size: 12px;
  padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.12);
}
.idc-k { opacity: .7; }
.idc-v { font-weight: 600; text-align: right; }
.idcard-qr {
  width: 124px; flex: none; align-self: flex-start; background: #fff;
  border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center;
}
.idcard-qr svg { width: 108px; height: 108px; display: block; }
.idcard-qr-na { width: 108px; height: 108px; display: flex; align-items: center; justify-content: center; color: #00471F; font-size: 10px; text-align: center; }
.idcard-qr-cap {
  color: #00471F; font-size: 9px; font-weight: 700; margin-top: 5px;
  text-transform: uppercase; letter-spacing: .5px; text-align: center;
}
.idcard-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: rgba(0,0,0,.18); font-size: 10px; opacity: .95;
}
.idcard-stamp {
  border: 1.5px solid #4ade80; color: #4ade80; padding: 2px 8px;
  border-radius: 6px; font-weight: 800; transform: rotate(-4deg);
}

/* Info rows */
.di-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 14px;
}
.di-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.di-row:last-child { border-bottom: none; }
.di-row:hover      { background: var(--bg3); }
.di-icon  { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.di-label { font-size: 12px; color: var(--muted); flex: 1; }
.di-val   { font-size: 13px; font-weight: 700; color: var(--cream); text-align: right; }

/* Notes */
.di-notes {
  font-size: 12px; color: var(--sand-dim);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
  line-height: 1.6;
}

/* Sell from detail */
.btn-sell-full {
  width: 100%; padding: 12px; border-radius: 12px;
  font-size: 13px; font-weight: 800;
  background: rgba(0,133,63,.09); border: 2px solid rgba(0,133,63,.25);
  color: var(--gold-lt); cursor: pointer; transition: all .2s;
}
.btn-sell-full:hover {
  background: rgba(0,133,63,.18); border-color: var(--gold-lt);
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,133,63,.2);
}

/* Santé tab */
.di-sante-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.btn-add-sm {
  padding: 6px 12px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: var(--gold-lt); color: #fff; border: none; cursor: pointer;
  transition: opacity .18s;
}
.btn-add-sm:hover { opacity: .85; }
.di-soin {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  margin-bottom: 8px;
  animation: slideUp .3s cubic-bezier(.16,1,.3,1) both;
}
.di-soin-badge  { font-size: 20px; flex-shrink: 0; border-radius: 8px; padding: 6px; }
.di-soin-info   { flex: 1; min-width: 0; }
.di-soin-title  { font-size: 13px; font-weight: 700; color: var(--cream); }
.di-soin-meta   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.di-soin-suivi  { font-size: 11px; color: var(--green); margin-top: 3px; }
.di-soin-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.di-soin-cost   { font-size: 12px; font-weight: 800; color: var(--gold-lt); }

/* ═══════════════════════════════════════════════════════
   VENTES & MARCHÉ
═══════════════════════════════════════════════════════ */
.offre-card {
  background: var(--card); border-radius: 16px; padding: 16px;
  border: 1px solid rgba(0,0,0,.06); margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform .15s, box-shadow .15s;
}
.offre-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.offre-card-head  { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.offre-animal-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.offre-animal-info { flex: 1; min-width: 0; }
.offre-animal-nom  { font-size: 15px; font-weight: 800; color: var(--cream); }
.offre-animal-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.offre-prix {
  font-size: 16px; font-weight: 900; color: var(--green); white-space: nowrap;
  background: rgba(0,98,46,.08); padding: 5px 10px; border-radius: 10px;
}
.offre-desc { font-size: 12px; color: var(--sand-dim); line-height: 1.55; margin: 0 0 12px; }
.offre-footer  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.offre-contact { font-size: 10px; color: var(--muted); }
.offre-actions { display: flex; gap: 8px; align-items: center; }
.offre-vendre-btn {
  background: var(--green); color: #fff; border: none; border-radius: 10px;
  padding: 7px 14px; font-size: 12px; font-weight: 800; cursor: pointer;
  transition: background .15s, transform .1s;
}
.offre-vendre-btn:hover { background: #005c28; transform: scale(1.03); }

.ventes-resume {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.ventes-resume-item {
  background: var(--card); border-radius: 12px; padding: 14px 10px; text-align: center;
  border: 1px solid rgba(0,0,0,.06);
}
.ventes-resume-val { font-size: 18px; font-weight: 900; color: var(--cream); }
.ventes-resume-lbl { font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-top: 3px; letter-spacing: .04em; }

.vente-hist-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; background: var(--card); border-radius: 13px; padding: 13px 14px;
  border: 1px solid rgba(0,0,0,.06); margin-bottom: 8px;
}
.vente-hist-left  { display: flex; gap: 10px; flex: 1; min-width: 0; }
.vente-hist-icon  { font-size: 22px; flex-shrink: 0; }
.vente-hist-nom   { font-size: 13px; font-weight: 800; color: var(--cream); }
.vente-hist-meta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.vente-hist-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.vente-hist-prix  { font-size: 14px; font-weight: 900; color: var(--green); }

/* ═══════════════════════════════════════════════════════
   CALENDRIER SANITAIRE
═══════════════════════════════════════════════════════ */
.sante-tabs {
  display: flex; gap: 6px; margin-bottom: 20px;
  background: var(--bg3); border-radius: 12px; padding: 4px;
}
.sante-tab {
  flex: 1; padding: 8px 12px; border-radius: 9px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: transparent; border: none; cursor: pointer;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sante-tab.active { background: var(--card); color: var(--cream); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.sante-tab-badge {
  background: var(--red); color: #fff; border-radius: 20px;
  font-size: 9px; font-weight: 900; padding: 1px 5px; min-width: 16px; text-align: center;
}
.cal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.cal-list { display: flex; flex-direction: column; gap: 6px; }
.cal-section { margin-bottom: 16px; }
.cal-section-title {
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.cal-section-count {
  background: var(--bg3); color: var(--muted); border-radius: 20px;
  font-size: 9px; padding: 1px 6px; font-weight: 700;
}
.cal-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s;
}
.cal-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.cal-card-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.cal-card-icon  { font-size: 18px; flex-shrink: 0; width: 32px; text-align: center; }
.cal-card-title { font-size: 12px; font-weight: 700; color: var(--cream); line-height: 1.4; }
.cal-card-meta  { font-size: 10px; color: var(--muted); margin-top: 2px; }
.cal-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.cal-card-due   { font-size: 11px; font-weight: 800; }
.cal-card-date  { font-size: 9px; color: var(--muted); }
.cal-done-btn {
  background: rgba(170,16,24,.1); color: var(--red); border: none; border-radius: 8px;
  padding: 3px 8px; font-size: 11px; font-weight: 800; cursor: pointer;
  transition: background .15s;
}
.cal-done-btn:hover { background: rgba(170,16,24,.2); }
.cal-validate-btn {
  background: rgba(0,98,46,.12); color: var(--green); border: 1.5px solid rgba(0,98,46,.25);
  border-radius: 9px; padding: 5px 10px; font-size: 11px; font-weight: 800;
  cursor: pointer; transition: background .15s, transform .1s; white-space: nowrap;
}
.cal-validate-btn:hover { background: rgba(0,98,46,.22); transform: scale(1.04); }

/* ═══════════════════════════════════════════════════════
   NAISSANCES
═══════════════════════════════════════════════════════ */
.nais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.nais-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 16px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.nais-card:hover { border-color: var(--gold-lt); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.nais-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nais-date-badge { font-size: 11px; font-weight: 700; color: var(--gold-lt); background: rgba(0,133,63,.08); padding: 4px 10px; border-radius: 20px; }
.nais-reg-btn { font-size: 10px !important; padding: 4px 10px !important; }
.nais-parents { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.nais-parent { flex: 1; min-width: 0; }
.nais-parent-role { display: block; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.nais-parent-name { font-size: 13px; font-weight: 700; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.nais-parent-name:hover { color: var(--gold-lt); }
.nais-dim { color: var(--muted) !important; font-style: italic; }
.nais-cross { font-size: 16px; color: var(--muted); flex-shrink: 0; padding: 0 2px; }
.nais-mere .nais-parent-name { color: #E0A800; }
.nais-pere .nais-parent-name { color: var(--gold-lt); }
.nais-stats { display: flex; gap: 12px; margin-bottom: 10px; }
.nais-stat { text-align: center; background: var(--bg3); border-radius: 10px; padding: 6px 12px; }
.nais-stat-val { font-size: 20px; font-weight: 900; color: var(--cream); line-height: 1; }
.nais-stat-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.nais-notes { font-size: 11px; color: var(--sand-dim); line-height: 1.55; border-top: 1px solid var(--border); padding-top: 10px; margin: 0; }
.nais-agneau-block:first-of-type { border-top: none !important; padding-top: 0 !important; margin-top: 0 !important; }

/* ── Naissance: bandeau sécurisé (carte) ── */
.nais-secure { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.nais-secure-photo { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; flex-shrink: 0; transition: transform .18s, border-color .18s; }
.nais-secure-photo:hover { transform: scale(1.04); border-color: var(--gold-lt); }
.nais-secure-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nais-secure-badge { font-size: 10px; font-weight: 800; color: var(--green); background: rgba(0,98,46,.1); padding: 3px 9px; border-radius: 20px; align-self: flex-start; }
.nais-secure-line { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nais-secure-geo { background: none; border: none; padding: 0; text-align: left; color: var(--gold-lt); font-weight: 600; cursor: pointer; font-family: inherit; }
.nais-secure-geo:hover { text-decoration: underline; }

/* ── Modal déclaration sécurisée ── */
.secure-banner { font-size: 11px; line-height: 1.5; color: var(--green); background: rgba(0,98,46,.08); border: 1px solid rgba(0,98,46,.18); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.secure-banner b { font-weight: 800; }

.secure-capture-btn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 14px; border: 2px dashed var(--gold-lt); border-radius: 14px; background: var(--bg3); cursor: pointer; transition: background .18s, border-color .18s, transform .12s; }
.secure-capture-btn:hover { background: var(--bg2); border-color: var(--gold); }
.secure-capture-btn:active { transform: scale(.99); }
.secure-capture-ico { font-size: 30px; }
.secure-capture-main { font-size: 14px; font-weight: 800; color: var(--gold-lt); }
.secure-capture-sub { font-size: 10px; color: var(--muted); }

.secure-photo-preview { position: relative; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--border); }
.secure-photo-preview img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.secure-photo-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; color: #fff; background: rgba(0,98,46,.85); padding: 4px 9px; border-radius: 20px; }
.secure-photo-retake { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; color: var(--cream); background: rgba(255,255,255,.92); border: none; padding: 5px 11px; border-radius: 20px; cursor: pointer; }
.secure-photo-retake:hover { background: #fff; }

.secure-stamp { font-size: 14px; font-weight: 800; color: var(--cream); background: var(--bg3); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; }

.secure-geo-row { display: flex; align-items: center; gap: 10px; background: var(--bg3); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; min-height: 48px; font-size: 13px; color: var(--cream); }
.secure-geo-ok { border-color: rgba(0,98,46,.35); }
.secure-geo-err { border-color: rgba(170,16,24,.3); }
.secure-geo-loading { color: var(--muted); }
.secure-geo-ico { font-size: 18px; flex-shrink: 0; }
.secure-geo-info { flex: 1; min-width: 0; }
.secure-geo-coords { font-size: 13px; font-weight: 800; color: var(--cream); }
.secure-geo-acc { font-size: 10px; color: var(--muted); margin-top: 1px; }
.secure-geo-refresh { font-size: 12px; font-weight: 700; color: var(--gold-lt); background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 5px 11px; cursor: pointer; flex-shrink: 0; }
.secure-geo-refresh:hover { background: #fff; border-color: var(--gold-lt); }
.secure-geo-start { width: 100%; padding: 8px; }
.secure-spin { width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--gold-lt); border-radius: 50%; display: inline-block; animation: secspin .7s linear infinite; }
@keyframes secspin { to { transform: rotate(360deg); } }

/* ── Caméra plein écran ── */
.cam-overlay { position: fixed; inset: 0; z-index: 4000; background: #000; display: flex; flex-direction: column; }
.cam-stage { position: relative; flex: 1; overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: 8% 8% 18%; border: 2px solid rgba(255,255,255,.55); border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.18); }
.cam-hint { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.cam-bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 26px calc(18px + env(safe-area-inset-bottom)); background: #000; }
.cam-btn-cancel { color: #fff; background: none; border: none; font-size: 15px; font-weight: 600; cursor: pointer; width: 80px; text-align: left; }
.cam-spacer { width: 80px; }
.cam-shutter { width: 70px; height: 70px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,.35); cursor: pointer; transition: transform .1s; }
.cam-shutter:active { transform: scale(.92); }

/* ── Lightbox photo ── */
.photo-view-box { position: relative; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.photo-view-box img { max-width: 92vw; max-height: 78vh; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.photo-view-close { font-size: 13px; font-weight: 700; color: var(--cream); background: #fff; border: none; padding: 9px 18px; border-radius: 24px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   PEDIGREE TREE
═══════════════════════════════════════════════════════ */
.ped-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.ped-tree {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.ped-col-parents {
  display: flex; flex-direction: column; gap: 10px;
}
.ped-col-gp {
  display: grid; grid-template-rows: 1fr 1fr 1fr 1fr; gap: 6px;
}
.ped-node {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  transition: border-color .18s, transform .18s;
}
.ped-node:hover { border-color: var(--gold-lt); transform: translateY(-1px); }
.ped-pere { border-left: 3px solid var(--gold-lt); flex: 1; }
.ped-mere { border-left: 3px solid #E0A800;        flex: 1; }
.ped-gpp, .ped-gpm { border-left: 3px solid rgba(0,133,63,.35); }
.ped-gmp, .ped-gmm { border-left: 3px solid rgba(184,122,20,.35); }
.ped-node-label   { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.ped-node-name    { font-size: 13px; font-weight: 800; color: var(--cream); line-height: 1.3; }
.ped-node-origine { font-size: 10px; color: var(--sand-dim); margin-top: 3px; }
.ped-troupeau-badge { font-size: 9px; margin-top: 5px; display: inline-block; }

/* Edit form section headers */
.ped-edit-section {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gold-lt);
  border-top: 1px solid var(--border); padding-top: 14px;
  margin: 14px 0 10px;
}
.ped-edit-section:first-of-type { border-top: none; margin-top: 0; }

/* ═══════════════════════════════════════════════════════
   SELL ANIMAL
═══════════════════════════════════════════════════════ */
.a-actions {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.btn-sell-card {
  width: 100%; padding: 7px 12px;
  border-radius: 9px; font-size: 12px; font-weight: 700;
  color: var(--gold-lt);
  background: rgba(0,133,63,.07);
  border: 1.5px solid rgba(0,133,63,.2);
  transition: all .2s; cursor: pointer;
}
.btn-sell-card:hover {
  background: rgba(0,133,63,.14);
  border-color: var(--gold-lt);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,133,63,.15);
}
.a-sold-to {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--sand-dim);
}
.a-owner-badge {
  font-size: 11px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}

.sell-preview {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.sell-preview-icon { font-size: 32px; flex-shrink: 0; }
.sell-preview-info { flex: 1; min-width: 0; }
.sell-preview-name { font-size: 16px; font-weight: 800; color: var(--cream); }
.sell-preview-meta { font-size: 12px; color: var(--sand-dim); margin-top: 2px; }
.sell-preview-val  { font-size: 12px; color: var(--gold-lt); margin-top: 4px; font-weight: 600; }

/* ─── Ventes list (profil) ─── */
.vente-list { display: flex; flex-direction: column; gap: 10px; }
.vente-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  transition: border-color .2s;
  animation: slideUp .3s cubic-bezier(.16,1,.3,1) both;
}
.vente-item:hover { border-color: var(--gold-lt); }
.vente-icon  { font-size: 22px; flex-shrink: 0; }
.vente-info  { flex: 1; min-width: 0; }
.vente-name  { font-size: 13px; font-weight: 700; color: var(--cream); }
.vente-meta  { font-size: 11px; color: var(--sand-dim); margin-top: 2px; }
.vente-notes { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vente-prix  { font-size: 13px; font-weight: 800; color: var(--green); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   PROFILE COMPLETION BAR
═══════════════════════════════════════════════════════ */
.completion-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.completion-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.completion-lbl { font-size: 13px; font-weight: 700; color: var(--cream); }
.completion-pct { font-size: 13px; font-weight: 700; color: var(--gold-lt); }
.completion-bar { height: 6px; border-radius: 99px; background: var(--bg4); overflow: hidden; }
.completion-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); animation: barGrow .8s cubic-bezier(.16,1,.3,1) both; }
.completion-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.completion-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
}
.completion-item.done { color: var(--green); }
.completion-item.todo { color: var(--muted); }

/* ═══════════════════════════════════════════════════════
   SOCIAL — topbar icons, composer photo, follow, comments,
   messages, notifications
═══════════════════════════════════════════════════════ */

/* Topbar icon buttons (messages + notifications) */
.icon-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: background .2s, transform .2s, border-color .2s;
}
.icon-btn:hover { background: var(--bg4); transform: scale(1.08); }
.icon-btn.active { border-color: var(--gold-lt); background: rgba(0,133,63,.08); }
.icon-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  border: 2px solid var(--bg2);
}

/* Composer photo attach */
.composer-bar { display: flex; align-items: center; margin-top: 10px; }
.composer-attach {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--green);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.composer-attach:hover { background: rgba(0,98,46,.08); border-color: var(--green); }
.composer-photo {
  position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); max-width: 320px;
}
.composer-photo img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.composer-photo-x {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.composer-photo-x:hover { background: rgba(170,16,24,.9); }

/* Suggestions — éleveurs à suivre */
.suggest-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; margin-bottom: 18px;
}
.suggest-title { font-size: 13px; font-weight: 800; color: var(--cream); margin-bottom: 12px; }
.suggest-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.suggest-card {
  flex: 0 0 auto; width: 150px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 13px; padding: 14px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.suggest-av { font-size: 30px; line-height: 1; }
.suggest-name { font-size: 13px; font-weight: 800; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.suggest-role { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.suggest-actions { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.suggest-follow {
  flex: 1; padding: 6px 8px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 700;
  transition: filter .2s, background .2s;
}
.suggest-follow:hover { filter: brightness(1.08); }
.suggest-follow.following { background: var(--bg4); color: var(--muted); }
.suggest-msg {
  width: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 13px;
  transition: background .2s, border-color .2s;
}
.suggest-msg:hover { background: rgba(0,133,63,.08); border-color: var(--gold-lt); }

/* Post follow + message buttons */
.post-follow {
  margin-left: auto; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  background: var(--green); color: #fff; border: none;
  font-size: 11.5px; font-weight: 700; transition: filter .2s, background .2s;
}
.post-follow:hover { filter: brightness(1.08); }
.post-follow.following { background: var(--bg4); color: var(--muted); }
.post-head .post-date { margin-left: 10px; }

.post-photo {
  display: block; width: 100%; max-height: 420px; object-fit: cover;
  border-radius: 12px; margin: 4px 0 10px; cursor: zoom-in;
  border: 1px solid var(--border);
}
.post-comment-btn, .post-msg-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: transparent; border: none; color: var(--muted);
  font-size: 12px; font-weight: 600; transition: background .2s, color .2s;
}
.post-comment-btn:hover, .post-msg-btn:hover { background: var(--bg3); color: var(--green); }
.post-msg-btn { margin-left: auto; }

/* Comments */
.comments { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { display: flex; gap: 9px; align-items: flex-start; }
.comment-av {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.comment-body { background: var(--bg3); border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-author { font-size: 12.5px; font-weight: 800; color: var(--cream); }
.comment-date { font-size: 10.5px; color: var(--muted); }
.comment-text { font-size: 13px; color: var(--cream); line-height: 1.45; word-break: break-word; }
.comment-compose { display: flex; gap: 9px; align-items: center; }
.comment-input {
  flex: 1; min-width: 0; padding: 9px 14px; border-radius: 99px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 13px; color: var(--cream); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.comment-input:focus { border-color: var(--gold-lt); box-shadow: 0 0 0 3px rgba(0,133,63,.08); }
.comment-send {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--green); color: #fff; font-size: 14px; cursor: pointer;
  transition: filter .2s; display: flex; align-items: center; justify-content: center;
}
.comment-send:hover { filter: brightness(1.08); }

/* Messages */
.msg-wrap { max-width: 760px; margin: 0 auto; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s;
}
.conv-item:hover { border-color: var(--gold-lt); box-shadow: 0 2px 14px rgba(0,133,63,.08); }
.conv-av {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-name { font-size: 14px; font-weight: 800; color: var(--cream); }
.conv-time { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.conv-preview { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-badge {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 800;
  line-height: 20px; text-align: center;
}

/* Message thread view */
.msg-thread-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px;
}
.msg-back {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border); font-size: 18px; color: var(--cream);
  transition: background .2s;
}
.msg-back:hover { background: var(--bg4); }
.msg-peer-av {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.msg-peer-name { font-size: 15px; font-weight: 800; color: var(--cream); }
.msg-peer-role { font-size: 11.5px; color: var(--muted); }
.msg-stream {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; min-height: 320px; max-height: 56vh; overflow-y: auto; margin-bottom: 12px;
}
.msg-empty { margin: auto; color: var(--muted); font-size: 13px; }
.msg-bubble {
  max-width: 75%; padding: 9px 14px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.45; position: relative; word-break: break-word;
  display: flex; flex-direction: column; gap: 3px;
}
.msg-bubble.mine { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.msg-bubble.theirs { align-self: flex-start; background: var(--bg3); color: var(--cream); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg-time { font-size: 10px; opacity: .7; align-self: flex-end; }
.msg-compose { display: flex; gap: 10px; align-items: center; }
.msg-input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14px; color: var(--cream); outline: none; transition: border-color .2s, box-shadow .2s;
}
.msg-input:focus { border-color: var(--gold-lt); box-shadow: 0 0 0 3px rgba(0,133,63,.08); }
.msg-send {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--green); color: #fff; font-size: 17px; cursor: pointer;
  transition: filter .2s; display: flex; align-items: center; justify-content: center;
}
.msg-send:hover { filter: brightness(1.08); }

/* Notifications panel (modal) */
.notif-panel {
  width: min(440px, 92vw); max-height: 80vh; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(11,31,59,.25);
  animation: modalUp .3s cubic-bezier(.16,1,.3,1) both;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-size: 16px; font-weight: 800; color: var(--cream); }
.notif-panel-close {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border); font-size: 13px; color: var(--muted);
  transition: background .2s;
}
.notif-panel-close:hover { background: var(--bg4); }
.notif-panel-body { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 11px; position: relative;
  padding: 11px 12px; border-radius: 11px; transition: background .2s;
}
.notif-item[data-action] { cursor: pointer; }
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { background: rgba(0,133,63,.06); }
.notif-emoji {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; color: var(--cream); line-height: 1.4; }
.notif-text strong { font-weight: 800; }
.notif-time { font-size: 11px; color: var(--muted); }
.notif-unread-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-lt); align-self: center;
}
.notif-empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════════════════════
   PROFILE PHOTO + BANNER (editable)
═══════════════════════════════════════════════════════ */
/* Avatar image fills any fixed-size avatar container, replacing emoji/initials */
.av-img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit;
  display: block;
}
.user-avatar, .composer-avatar, .post-avatar, .comment-av, .profil-av-lg { overflow: hidden; }

/* Hero becomes a vertical card: full-bleed banner on top, body below */
.profil-hero {
  flex-direction: column; align-items: stretch;
  gap: 0; padding: 0;
}
.profil-banner {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg, var(--green, #00622e), var(--gold, #E0A800));
  background-size: cover; background-position: center;
}
.profil-banner.has-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45));
}
.profil-banner-actions {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: flex; gap: 8px;
}
.banner-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20,20,20,.55); color: #fff;
  border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 7px 13px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .15s;
}
.banner-btn:hover { background: rgba(20,20,20,.78); transform: translateY(-1px); }

.profil-hero-body {
  display: flex; align-items: flex-end; gap: 22px;
  padding: 0 28px 26px; margin-top: -42px;
}
.profil-av-wrap { position: relative; flex-shrink: 0; }
.profil-hero .profil-av-lg {
  border: 4px solid var(--card);
  position: relative; z-index: 1;
}
.profil-av-edit, .profil-av-remove {
  position: absolute; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0;
  transition: transform .15s, filter .15s;
}
.profil-av-edit {
  right: -4px; bottom: -4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: #fff;
}
.profil-av-remove {
  right: -4px; top: -4px;
  background: #b23b3b; color: #fff; font-size: 12px;
}
.profil-av-edit:hover, .profil-av-remove:hover { transform: scale(1.12); }
.profil-hero-info { padding-bottom: 4px; min-width: 0; }

@media (max-width: 640px) {
  .profil-hero-body { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .profil-hero-info { padding-bottom: 0; }
}

/* ═══════════════════════════════════════════════════════
   PERSONNEL (gestion du troupeau)
═══════════════════════════════════════════════════════ */
.perso-list { display: flex; flex-direction: column; gap: 10px; }
.perso-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
  animation: fadeUp .4s ease both;
  transition: border-color .15s, transform .15s;
}
.perso-item:hover { border-color: var(--gold-lt); transform: translateY(-1px); }
.perso-item.inactive { opacity: .58; }
.perso-av {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(0,98,46,.16), rgba(184,122,20,.16));
  border: 1px solid var(--border);
}
.perso-info { flex: 1; min-width: 0; }
.perso-name { font-size: 14px; font-weight: 700; color: var(--cream); display: flex; align-items: center; gap: 8px; }
.perso-tag-off {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(178,59,59,.18); color: #e08585;
  padding: 2px 7px; border-radius: 999px;
}
.perso-meta  { font-size: 12px; color: var(--sand-dim); margin-top: 2px; }
.perso-notes { font-size: 11px; color: var(--muted); margin-top: 4px; }
.perso-actions { display: flex; gap: 6px; flex-shrink: 0; }
.perso-btn {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; line-height: 1;
  transition: background .15s, transform .15s, border-color .15s;
}
.perso-btn:hover { transform: scale(1.08); border-color: var(--gold-lt); }
.perso-del:hover { background: rgba(178,59,59,.16); border-color: #b23b3b; }

.perso-empty { text-align: center; padding: 28px 16px; }
.perso-empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .7; }
.perso-empty p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ═══════════════════════════════════════════════════════
   BERGERIE (élevage mis en avant sur le profil éleveur)
═══════════════════════════════════════════════════════ */
.badge-bergerie {
  background: linear-gradient(135deg, rgba(0,133,63,.16), rgba(0,98,46,.14));
  color: var(--gold-lt); font-weight: 700;
}
.bergerie-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--card), var(--bg3));
  border: 1px solid var(--gold-lt);
  border-radius: 18px; padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px -14px rgba(0,133,63,.5);
  position: relative; overflow: hidden;
}
.bergerie-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--green));
}
.bergerie-icon {
  width: 54px; height: 54px; flex-shrink: 0; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(0,133,63,.16), rgba(0,98,46,.16));
  border: 1px solid var(--border);
}
.bergerie-body { flex: 1; min-width: 0; }
.bergerie-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--sand-dim); margin-bottom: 3px;
}
.bergerie-name {
  font-family: var(--fd, serif); font-size: 21px; font-weight: 700; line-height: 1.1;
  color: var(--gold-lt); word-break: break-word;
}
.bergerie-meta { font-size: 12px; color: var(--sand-dim); margin-top: 4px; }
.bergerie-empty { font-size: 13px; color: var(--muted); line-height: 1.5; }
.bergerie-edit {
  flex-shrink: 0; align-self: flex-start;
  background: var(--card); border: 1px solid var(--gold-lt); color: var(--gold-lt);
  font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; transition: background .15s, transform .15s;
}
.bergerie-edit:hover { background: var(--bg3); transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   SURVEILLANCE (caméras)
═══════════════════════════════════════════════════════ */
.surv-wrap { max-width: 1180px; margin: 0 auto; }

.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--sh-card); text-align: center;
}
.stat-ico { font-size: 22px; line-height: 1; }
.stat-val { font-family: var(--fd); font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1.1; margin-top: 4px; }
.stat-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }

.surv-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 18px; box-shadow: var(--sh-card); margin-bottom: 22px;
}
.surv-api-note { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 240px; }
.surv-api-ico { font-size: 22px; line-height: 1.2; }
.surv-api-note strong { display: block; font-size: 13px; color: var(--cream); margin-bottom: 2px; }
.surv-api-note span { font-size: 12px; color: var(--sand-dim); line-height: 1.5; }
.surv-api-note code { background: var(--bg3); border-radius: 5px; padding: 1px 5px; font-size: 11px; color: var(--gold); }
.surv-add-btn { white-space: nowrap; }

.surv-empty {
  text-align: center; background: var(--card); border: 1px dashed var(--border2);
  border-radius: var(--r); padding: 48px 24px; box-shadow: var(--sh-card);
}
.surv-empty-ico { font-size: 48px; opacity: .8; }
.surv-empty h3 { font-family: var(--fd); font-size: 22px; color: var(--cream); margin: 12px 0 6px; }
.surv-empty p { font-size: 13px; color: var(--sand-dim); max-width: 440px; margin: 0 auto 18px; line-height: 1.6; }

.surv-form-hint {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; color: var(--sand-dim); line-height: 1.5; margin-top: 4px;
}

.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cam-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--sh-card); animation: slideUp .5s cubic-bezier(.16,1,.3,1) both;
  transition: transform .2s, box-shadow .2s;
}
.cam-card:hover { transform: translateY(-3px); box-shadow: var(--sh-float); }
.cam-card-feed { cursor: pointer; }

/* ── Feed CCTV ── */
.cam-feed {
  position: relative; aspect-ratio: 16 / 9; background: #0a0e16; overflow: hidden;
}
.cam-feed-lg { aspect-ratio: 16 / 9; border-radius: 12px; }
.cam-scene, .cam-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border: none; }
.cam-media-error { display: none; }
.cam-sheep { animation: camGraze 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cam-sheep:nth-of-type(2) { animation-delay: -2s; }
.cam-sheep:nth-of-type(3) { animation-delay: -4s; }
@keyframes camGraze {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(2px); }
}
.cam-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 0 0, #fff 0, #fff .5px, transparent 1px, transparent 2px);
  background-size: 3px 3px; animation: camGrain .5s steps(3) infinite;
}
@keyframes camGrain { 0% { transform: translate(0,0); } 33% { transform: translate(-1px,1px); } 66% { transform: translate(1px,-1px); } }
.cam-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,0) 3px);
  background-size: 100% 4px; opacity: .5;
}
.cam-offline {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #6b7a90; font-size: 13px; font-weight: 600;
  background: repeating-linear-gradient(45deg, #11151d, #11151d 12px, #0c1017 12px, #0c1017 24px);
}
.cam-offline-ico { font-size: 30px; opacity: .5; }

.cam-overlay-ui { position: absolute; inset: 0; pointer-events: none; color: #fff; font-family: var(--fb); }
.cam-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; }
.cam-bottom { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; }
.cam-live {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .6px;
  background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(2px);
}
.cam-live.off { color: #c0c7d2; }
.cam-dot { width: 7px; height: 7px; border-radius: 50%; background: #29d36b; box-shadow: 0 0 6px #29d36b; animation: camBlink 1.6s infinite; }
.cam-rec {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .6px;
  background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 99px; color: #ff5b5b; backdrop-filter: blur(2px);
}
.cam-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff3b3b; animation: camBlink 1.2s infinite; }
@keyframes camBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.cam-zone, .cam-ts {
  font-size: 11px; font-weight: 700; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 6px;
  backdrop-filter: blur(2px); font-variant-numeric: tabular-nums;
}
.cam-demo-tag {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-8deg);
  font-size: 13px; font-weight: 900; letter-spacing: 3px; color: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.22); padding: 3px 12px; border-radius: 6px;
}

.cam-card-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cam-card-info { flex: 1; min-width: 0; }
.cam-card-name { font-size: 14px; font-weight: 700; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-card-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Switch on/off ── */
.cam-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.cam-switch input { opacity: 0; width: 0; height: 0; }
.cam-switch-track {
  position: absolute; inset: 0; background: var(--bg4); border-radius: 99px; transition: background .2s;
}
.cam-switch-track::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.cam-switch input:checked + .cam-switch-track { background: var(--green); }
.cam-switch input:checked + .cam-switch-track::before { transform: translateX(18px); }

.cam-card-actions { display: flex; border-top: 1px solid var(--border); }
.cam-act {
  flex: 1; padding: 10px 6px; font-size: 12px; font-weight: 600; color: var(--sand-dim);
  transition: background .15s, color .15s;
}
.cam-act + .cam-act { border-left: 1px solid var(--border); }
.cam-act:hover { background: var(--bg3); color: var(--gold); }
.cam-act-danger:hover { background: rgba(170,16,24,.08); color: var(--red); }

/* ── Plein écran ── */
.cam-full-box { max-width: 760px; width: 100%; }
.cam-full-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cam-full-x {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg3); color: var(--sand-dim);
  font-size: 14px; font-weight: 700; flex-shrink: 0; transition: background .15s, color .15s;
}
.cam-full-x:hover { background: var(--bg4); color: var(--cream); }

@media (max-width: 560px) {
  .cam-grid { grid-template-columns: 1fr; }
  .surv-toolbar { flex-direction: column; align-items: stretch; }
  .surv-add-btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   ALIMENTATION
═══════════════════════════════════════════════════════ */
.alim-wrap { max-width: 1180px; margin: 0 auto; }

.alim-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--sh-card); margin-top: 22px;
}
.alim-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.alim-card-ico { font-size: 24px; line-height: 1.1; }
.alim-card-head strong { display: block; font-family: var(--fd); font-size: 17px; color: var(--cream); }
.alim-card-head span { font-size: 12.5px; color: var(--sand-dim); line-height: 1.5; }

/* ── Calculateur ── */
.alim-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.alim-calc-form { display: flex; flex-direction: column; gap: 12px; }
.alim-field { display: flex; flex-direction: column; gap: 5px; }
.alim-field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.alim-field select, .alim-field input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--cream); font-size: 14px; font-family: var(--fb);
}
.alim-field select:focus, .alim-field input:focus { outline: none; border-color: var(--gold); }

.alim-res {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.alim-res-item { text-align: center; padding: 6px 4px; }
.alim-res-ico { font-size: 20px; }
.alim-res-val { font-family: var(--fd); font-size: 24px; font-weight: 700; color: var(--gold); line-height: 1.1; margin-top: 2px; }
.alim-res-ms .alim-res-val { color: var(--cream); }
.alim-res-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-top: 2px; }

/* ── Référentiel ── */
.alim-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.alim-ref { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.alim-ref-top { display: flex; align-items: center; gap: 8px; }
.alim-ref-ico { font-size: 18px; }
.alim-ref-name { font-size: 14px; font-weight: 700; color: var(--cream); }
.alim-ref-desc { font-size: 12px; color: var(--sand-dim); line-height: 1.45; margin: 6px 0 8px; }
.alim-ref-coefs { display: flex; flex-wrap: wrap; gap: 6px; }
.alim-ref-coefs span {
  font-size: 11px; font-weight: 700; color: var(--gold);
  background: var(--bg4); border-radius: 6px; padding: 2px 7px;
}

/* ── Plan du troupeau ── */
.alim-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.alim-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.alim-table th {
  text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 11px 12px; background: var(--bg3); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.alim-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--cream); vertical-align: middle; }
.alim-table tbody tr:last-child td { border-bottom: none; }
.alim-table tbody tr:hover td { background: var(--bg3); }
.alim-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.alim-td-animal { display: flex; align-items: center; gap: 10px; }
.alim-animal-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--bg4); overflow: hidden;
}
.alim-animal-ico .animal-photo-img { width: 100%; height: 100%; object-fit: cover; }
.alim-animal-name { font-size: 13.5px; font-weight: 700; color: var(--cream); }
.alim-animal-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.alim-plan-etat {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--cream); font-size: 12.5px; font-family: var(--fb); cursor: pointer;
}
.alim-plan-etat:focus { outline: none; border-color: var(--gold); }
.alim-table tfoot td {
  padding: 12px; font-weight: 800; color: var(--cream); background: var(--bg3);
  border-top: 2px solid var(--border2);
}
.alim-table tfoot td:first-child { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--sand-dim); }

.alim-empty { text-align: center; padding: 36px 18px; color: var(--sand-dim); }
.alim-empty-ico { font-size: 40px; opacity: .8; }
.alim-empty p { font-size: 13px; max-width: 420px; margin: 10px auto 0; line-height: 1.6; }

@media (max-width: 720px) {
  .alim-calc { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   INTÉGRATION & PARTAGE FACEBOOK / TIKTOK
═══════════════════════════════════════════════════════ */
/* Composer: champ lien d'intégration */
.composer-embed-input {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--cream);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.composer-embed-input::placeholder { color: var(--muted); }
.composer-embed-input:focus {
  border-color: var(--gold);
  background: #fff;
}

/* Embed rendu dans une publication */
.post-embed {
  margin: 10px 0 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.post-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #000;
}
.post-embed-tiktok { max-width: 360px; }
.post-embed-link {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--gold);
  background: var(--card);
  text-decoration: none;
}
.post-embed-link:hover { background: var(--bg3); }

/* Boutons Partager */
.post-share-btn,
.offre-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gold);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.post-share-btn:hover,
.offre-share-btn:hover { background: rgba(37, 99, 235, .1); }
.offre-share-btn {
  border: 1px solid var(--border);
  margin-right: auto;
}

/* Bouton partage sur carte animal */
.a-share {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.a-share:hover { background: rgba(37, 99, 235, .12); transform: translateY(-1px); }
.a-head { position: relative; }

/* Panneau de partage (modale) */
.share-panel {
  width: min(460px, 94vw);
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  animation: modalIn .25s ease;
}
.share-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.share-panel-title { font-size: 16px; font-weight: 800; margin: 0; }
.share-panel-title span { color: var(--gold); }
.share-preview {
  margin: 16px 20px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--cream);
  white-space: pre-wrap;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 160px;
  overflow-y: auto;
}
.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 20px;
}
.share-net {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.share-net:hover { filter: brightness(1.07); transform: translateY(-1px); }
.share-net:active { transform: translateY(0); }
.share-net-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 900;
  background: rgba(255, 255, 255, .22);
  border-radius: 7px;
}
.share-fb { background: #1877f2; }
.share-tt { background: #010101; }
.share-wa { background: #25d366; }
.share-cp { background: #64748b; }
.share-nv { background: var(--gold); }
.share-note {
  margin: 14px 20px 20px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 480px) {
  .share-grid { grid-template-columns: 1fr; }
}

/* ═══ Gestion des stocks ═══ */
.stocks-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.stocks-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.stock-filter {
  padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: var(--card); border: 1.5px solid var(--border); color: var(--cream);
  cursor: pointer; transition: all .18s;
}
.stock-filter:hover { border-color: var(--gold-lt); }
.stock-filter.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-lt) 70%);
  border-color: var(--gold); color: #fff;
}
.stock-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.stock-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .2s, transform .2s; animation: upIn .4s both;
}
.stock-card:hover { box-shadow: 0 8px 24px rgba(0,133,63,.10); transform: translateY(-2px); }
.stock-card-head { display: flex; align-items: center; gap: 12px; }
.stock-cat-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--bg3);
}
.stock-card-info { flex: 1; min-width: 0; }
.stock-card-name { font-size: 15px; font-weight: 700; color: var(--cream); }
.stock-card-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stock-badge {
  flex-shrink: 0; padding: 4px 11px; border-radius: 99px;
  font-size: 11px; font-weight: 800;
}
.stock-note {
  font-size: 12px; font-style: italic; color: var(--muted);
  background: var(--bg3); border-radius: 9px; padding: 7px 10px;
}
.stock-card-foot { display: flex; align-items: center; gap: 12px; }
.stock-qty { display: flex; align-items: center; gap: 8px; }
.stock-qty-btn {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--bg2); color: var(--cream);
  font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.stock-qty-btn:hover { border-color: var(--gold-lt); color: var(--gold-lt); }
.stock-qty-val { min-width: 50px; text-align: center; }
.stock-qty-val strong { display: block; font-size: 18px; font-weight: 800; color: var(--cream); line-height: 1; }
.stock-qty-val span { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.stock-seuil { flex: 1; font-size: 12px; color: var(--muted); }
.stock-del {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; cursor: pointer;
  border: none; background: rgba(227,27,35,.10); color: var(--red);
  font-size: 15px; display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.stock-del:hover { background: rgba(227,27,35,.20); }
@media (max-width: 560px) { .stock-grid { grid-template-columns: 1fr; } }
