/* ============================================================
   EquiSuivi — Design System
   Mobile-first, zero external dependencies
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand colors */
  --color-forest:   #2D5016;
  --color-forest-dark: #1e3a0f;
  --color-forest-light: #3d6b1f;
  --color-beige:    #F5F0E8;
  --color-brown:    #8B6914;
  --color-brown-light: #c49a2a;
  --color-offwhite: #FAFAF8;
  --color-text:     #1a1a1a;
  --color-muted:    #6b7280;
  --color-border:   #d1cbbf;
  --color-danger:   #c0392b;
  --color-danger-dark: #96281b;
  --color-success:  #27ae60;
  --color-warning:  #e67e22;
  --color-info:     #2980b9;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.16);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 56px;

  /* Luxe — or & vert premium */
  --color-gold:        #C9A84C;
  --color-gold-light:  #E8C97A;
  --color-gold-dark:   #A07830;
  --color-gold-shine:  #FFE08A;
  --color-forest-rich: #1A3A0A;
  --gradient-luxury:   linear-gradient(135deg, #2D5016 0%, #1A3A0A 50%, #2D5016 100%);
  --gradient-gold:     linear-gradient(135deg, #A07830 0%, #C9A84C 40%, #FFE08A 60%, #C9A84C 80%, #A07830 100%);
  --gradient-green-gold: linear-gradient(135deg, #2D5016 0%, #3d6b1f 40%, #C9A84C 100%);
  --shadow-gold:       0 4px 20px rgba(201,168,76,.35);
  --shadow-luxury:     0 8px 32px rgba(0,0,0,.25), 0 2px 8px rgba(201,168,76,.15);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-offwhite);
  min-height: 100dvh;
}

a {
  color: var(--color-forest);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; display: block; }

button, input, select, textarea {
  font: inherit;
}

ul[role="list"], ol[role="list"] { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Utility: Hidden ────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Utility: Flex ──────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.flex-1       { flex: 1 1 0%; }

.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }

.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mt-8   { margin-top: 32px; }
.mb-2   { margin-bottom: 8px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }

/* ── Utility: Text ──────────────────────────────────────────── */
.text-muted   { color: var(--color-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .75rem; }
.text-lg      { font-size: 1.125rem; }
.text-xl      { font-size: 1.25rem; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.truncate     { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Auth Container ─────────────────────────────────────────── */
#auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-forest-dark) 100%);
  padding: 24px 16px;
}

.auth-card {
  background: var(--color-offwhite);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-icon  { font-size: 3rem; display: block; }
.auth-logo-name  {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-forest);
  margin-top: 8px;
}
.auth-logo-tagline {
  font-size: .875rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--color-border);
}
.auth-tab-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--transition-base), border-color var(--transition-base);
  min-height: 44px;
}
.auth-tab-btn.active {
  color: var(--color-forest);
  border-bottom-color: var(--color-forest);
}

/* ── App Shell Layout ───────────────────────────────────────── */
#app-shell {
  display: flex;
  min-height: 100dvh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--color-forest);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#sidebar.open {
  transform: translateX(0);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon { font-size: 1.5rem; }
.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.sidebar-close-btn {
  color: rgba(255,255,255,.7);
  background: none;
  border: none;
}
.sidebar-close-btn:hover { color: #fff; }

.sidebar-search {
  padding: 12px 16px;
  position: relative;
}
.sidebar-search .form-input {
  background: rgba(255,255,255,.12);
  border-color: transparent;
  color: #fff;
  width: 100%;
}
.sidebar-search .form-input::placeholder { color: rgba(255,255,255,.55); }
.sidebar-search .form-input:focus {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.4);
  outline: none;
}

.search-results {
  position: absolute;
  top: calc(100% - 4px);
  left: 16px;
  right: 16px;
  background: var(--color-offwhite);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 280px;
  overflow-y: auto;
  color: var(--color-text);
}
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--color-beige); }
.search-result-category {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
  font-weight: 600;
  padding: 8px 14px 4px;
}

/* ── Nav List ───────────────────────────────────────────────── */
.nav-list {
  padding: 8px 0;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,.8);
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  font-size: .95rem;
  min-height: 44px;
}
.nav-item a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}
.nav-item a.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 600;
}
.nav-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-item-label { flex: 1; }

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sidebar-actions .btn {
  flex: 1;
  min-width: 80px;
  font-size: .8rem;
  padding: 8px 10px;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
}
.sidebar-actions .btn:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.sidebar-logout {
  width: 100%;
}

/* ── Main Wrapper ───────────────────────────────────────────── */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 0;
  transition: margin-left var(--transition-slow);
}

/* ── Top Bar (mobile) ───────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 16px;
  background: var(--color-forest);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.hamburger-btn {
  color: #fff;
  background: none;
  border: none;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.top-bar-title {
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  padding: 20px 16px;
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── Desktop layout ─────────────────────────────────────────── */
@media (min-width: 768px) {
  #sidebar {
    transform: translateX(0);
    position: sticky;
    top: 0;
    height: 100dvh;
    flex-shrink: 0;
  }
  .sidebar-close-btn { display: none; }
  .sidebar-backdrop  { display: none !important; }

  #main-wrapper {
    margin-left: 0;
  }
  .top-bar {
    display: none;
  }
  .main-content {
    padding: 32px 32px;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 40px 48px;
  }
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: .9rem;
  line-height: 1;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn:focus-visible {
  outline: 3px solid var(--color-brown);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-forest);
  color: #fff;
  border-color: var(--color-forest);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-forest-dark);
  border-color: var(--color-forest-dark);
}

.btn-secondary {
  background: var(--color-beige);
  color: var(--color-forest);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: #ede7d8;
  border-color: var(--color-brown);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--color-forest);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-beige);
}

.btn-sm {
  padding: 7px 14px;
  font-size: .8rem;
  min-height: 36px;
}

.btn-icon {
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-beige);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-forest);
}
.card-body {
  padding: 20px;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-forest);
  box-shadow: 0 0 0 3px rgba(45,80,22,.12);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--color-danger);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}
.form-select { cursor: pointer; }
.form-hint {
  font-size: .78rem;
  color: var(--color-muted);
}
.form-error {
  font-size: .8rem;
  color: var(--color-danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--color-offwhite);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--transition-slow);
}
.modal-lg  { max-width: 740px; }
.modal-sm  { max-width: 380px; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-forest);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.modal-footer:empty { display: none; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100% - 32px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: .9rem;
  pointer-events: all;
  animation: toastIn var(--transition-base) forwards;
  background: #333;
  color: #fff;
  word-break: break-word;
}
.toast.removing {
  animation: toastOut var(--transition-slow) forwards;
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

.toast-success { background: var(--color-success); }
.toast-error   { background: var(--color-danger);  }
.toast-warning { background: var(--color-warning); }
.toast-info    { background: var(--color-info);    }
.toast-icon    { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  margin-left: auto;
  padding: 0 0 0 8px;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
  pointer-events: all;
}
.toast-close:hover { color: #fff; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.4;
}
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-yellow  { background: #fef9c3; color: #92400e; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-brown   { background: #fef3c7; color: var(--color-brown); }
.badge-muted   { background: #f3f4f6; color: var(--color-muted); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
thead {
  background: var(--color-beige);
}
th {
  padding: 12px 14px;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-beige); }
td .btn-icon { min-height: 36px; min-width: 36px; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  min-height: 44px;
}
.tab-btn:hover { color: var(--color-forest); }
.tab-btn.active {
  color: var(--color-forest);
  border-bottom-color: var(--color-forest);
  font-weight: 600;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-beige);
  border: 2px solid var(--color-border);
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.25rem;
}
.avatar-sm  { width: 36px; height: 36px; }
.avatar-md  { width: 48px; height: 48px; }
.avatar-lg  { width: 72px; height: 72px; font-size: 2rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 2.5rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-forest);
}
.page-subtitle {
  font-size: .875rem;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ── Stats / KPI Cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1;
}
.stat-label {
  font-size: .8rem;
  color: var(--color-muted);
  margin-top: 6px;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.empty-state-text { font-size: .875rem; margin-bottom: 20px; }

/* ── Horse Card (grid list) ─────────────────────────────────── */
.horses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) {
  .horses-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .horses-grid { grid-template-columns: repeat(3, 1fr); }
}

.horse-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}
.horse-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.horse-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--color-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.horse-card-body {
  padding: 14px 16px;
}
.horse-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-forest);
}
.horse-card-meta {
  font-size: .8rem;
  color: var(--color-muted);
  margin-top: 4px;
}
.horse-card-actions {
  padding: 10px 16px 14px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--color-border);
}

/* ── Section Selector (horse picker) ───────────────────────── */
.horse-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.horse-selector-bar .form-select {
  max-width: 280px;
}

/* ── Timeline / Activity Feed ───────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-forest);
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-date {
  font-size: .78rem;
  color: var(--color-muted);
}

/* ── Alerts / Due soon ──────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  margin-bottom: 12px;
}
.alert-warning { background: #fff7ed; border-left: 4px solid var(--color-warning); }
.alert-danger  { background: #fef2f2; border-left: 4px solid var(--color-danger);  }
.alert-info    { background: #eff6ff; border-left: 4px solid var(--color-info);    }
.alert-success { background: #f0fdf4; border-left: 4px solid var(--color-success); }

/* ── Dashboard activity list ────────────────────────────────── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .875rem;
}
.activity-item:last-child { border-bottom: none; }

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  #sidebar,
  .top-bar,
  .btn,
  .tab-nav,
  .horse-card-actions,
  .sidebar-footer,
  #modal-overlay,
  #toast-container { display: none !important; }

  #main-wrapper { margin-left: 0 !important; }
  .main-content  { padding: 0 !important; }
  body           { background: #fff; }
  .card          { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   Animations — keyframes & utility classes
   ============================================================ */

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Animation utility classes ──────────────────────────────── */
.animate-fade-up    { animation: fadeInUp     280ms ease both; }
.animate-fade-down  { animation: fadeInDown   280ms ease both; }
.animate-fade-left  { animation: fadeInLeft   280ms ease both; }
.animate-fade-right { animation: fadeInRight  280ms ease both; }
.animate-scale-in   { animation: scaleIn      200ms ease both; }
.animate-pulse      { animation: pulse        1.4s  ease infinite; }
.animate-spin       { animation: spin          .8s  linear infinite; }
.animate-bounce-in  { animation: bounceIn     400ms ease both; }
.animate-slide-right{ animation: slideInRight 300ms ease both; }

/* ── Stagger delays ─────────────────────────────────────────── */
.delay-1 { animation-delay:  60ms; }
.delay-2 { animation-delay: 120ms; }
.delay-3 { animation-delay: 180ms; }
.delay-4 { animation-delay: 240ms; }
.delay-5 { animation-delay: 300ms; }

/* ── Skeleton loader ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
  display: block;
}

/* ── Card hover transitions ─────────────────────────────────── */
.card-hover {
  transition: box-shadow 200ms ease, transform 200ms ease;
  cursor: pointer;
}
.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* ── Page transition ────────────────────────────────────────── */
.page-enter {
  animation: fadeInUp 240ms ease both;
}

/* ── Button loading state ───────────────────────────────────── */
.btn-loading { pointer-events: none; opacity: .7; }
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Map container ──────────────────────────────────────────── */
.map-container {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--color-muted);
  font-size: .9rem;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Member linked badges ───────────────────────────────────── */
.member-linked { border-left: 3px solid var(--color-success); }
.member-owner  { border-left: 3px solid var(--color-brown); }

/* ── Horse detail hero ──────────────────────────────────────── */
.horse-detail-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  overflow: hidden;
}
.horse-detail-hero img {
  width: 100%; height: 100%; object-fit: cover;
}
.horse-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .horse-info-grid { grid-template-columns: repeat(3, 1fr); }
}
.horse-info-item {
  background: var(--color-beige);
  border-radius: var(--radius-md);
  padding: 12px;
}
.horse-info-label {
  font-size: .72rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.horse-info-value {
  font-weight: 600;
  margin-top: 2px;
  color: var(--color-forest);
}

/* ── Notification badge ─────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--color-danger);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: bounceIn 400ms ease;
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--color-beige);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}
.progress-bar {
  height: 100%;
  background: var(--color-forest);
  border-radius: var(--radius-full);
  transition: width 600ms ease;
}

/* ============================================================
   Thème Luxe — EquiSuivi Premium
   ============================================================ */

/* Sidebar luxe */
#sidebar {
  background: var(--gradient-luxury) !important;
  border-right: 1px solid rgba(201,168,76,.2);
  position: relative;
}
#sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(201,168,76,.4), transparent);
  pointer-events: none;
}
.sidebar-logo-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-item a.active {
  background: rgba(201,168,76,.18) !important;
  border-left: 3px solid var(--color-gold) !important;
  color: var(--color-gold-light) !important;
}
.nav-item a:hover {
  border-left: 3px solid rgba(201,168,76,.4) !important;
}

/* Auth card luxe */
.auth-card {
  background: linear-gradient(160deg, #fff 0%, #fafaf5 100%);
  border: 1px solid rgba(201,168,76,.3);
  box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 4px 12px rgba(201,168,76,.1);
}
.auth-logo-name {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2rem;
  letter-spacing: .04em;
}
.auth-logo-icon {
  filter: drop-shadow(0 2px 8px rgba(201,168,76,.5));
}

/* Bouton primary luxe */
.btn-primary {
  background: var(--gradient-gold) !important;
  color: var(--color-forest-rich) !important;
  border: none !important;
  font-weight: 700 !important;
  letter-spacing: .03em;
  box-shadow: var(--shadow-gold) !important;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transition: left 400ms ease;
}
.btn-primary:hover:not(:disabled)::before { left: 100%; }
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(201,168,76,.55) !important;
  transform: translateY(-1px);
}

/* Cards luxe */
.card {
  border: 1px solid rgba(201,168,76,.15) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 1px 3px rgba(201,168,76,.08) !important;
  transition: box-shadow 250ms ease, transform 250ms ease, border-color 250ms ease !important;
}
.card:hover {
  border-color: rgba(201,168,76,.35) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.1), 0 2px 8px rgba(201,168,76,.18) !important;
}
.card-header {
  background: linear-gradient(to right, #faf8f2, #f5f0e8) !important;
  border-bottom: 1px solid rgba(201,168,76,.2) !important;
}
.card-title {
  color: var(--color-forest-rich) !important;
  letter-spacing: .02em;
}

/* Stat cards luxe */
.stat-card {
  background: linear-gradient(135deg, #fff 0%, #faf8f0 100%);
  border: 1px solid rgba(201,168,76,.2) !important;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(201,168,76,.12) 0%, transparent 70%);
  pointer-events: none;
}
.stat-value { color: var(--color-forest-rich) !important; font-size: 2.2rem !important; }

/* Horse cards luxe */
.horse-card {
  border: 1px solid rgba(201,168,76,.2) !important;
  transition: box-shadow 250ms ease, transform 250ms ease, border-color 250ms ease !important;
}
.horse-card:hover {
  border-color: rgba(201,168,76,.5) !important;
  box-shadow: var(--shadow-luxury) !important;
  transform: translateY(-4px) !important;
}
.horse-card-name { color: var(--color-forest-rich) !important; font-size: 1.1rem !important; letter-spacing: .01em; }

/* Page title luxe */
.page-title {
  font-size: 1.75rem !important;
  letter-spacing: .02em;
  position: relative;
  display: inline-block;
}
.page-title::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 40px; height: 2px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

/* Scrollbar luxe */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-beige); }
::-webkit-scrollbar-thumb { background: var(--color-gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-dark); }

/* Badge gold */
.badge-gold {
  background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(201,168,76,.4);
}

/* Formulaires luxe */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-gold) !important;
  box-shadow: 0 0 0 3px rgba(201,168,76,.18) !important;
}

/* Tab nav luxe */
.tab-btn.active {
  color: var(--color-gold-dark) !important;
  border-bottom-color: var(--color-gold) !important;
}
.auth-tab-btn.active {
  color: var(--color-gold-dark) !important;
  border-bottom-color: var(--color-gold) !important;
}

/* Top bar luxe */
.top-bar {
  background: var(--gradient-luxury) !important;
  border-bottom: 1px solid rgba(201,168,76,.3) !important;
}

/* Auth container luxe */
#auth-container {
  background: radial-gradient(ellipse at 30% 20%, #3d6b1f 0%, #1A3A0A 50%, #0d2208 100%) !important;
}
#auth-container::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(201,168,76,.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(201,168,76,.06) 0%, transparent 40%);
  pointer-events: none;
}

/* Divider décoratif */
.luxury-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold), transparent);
  margin: 24px 0;
  opacity: .5;
}

/* Keyframe shimmer gold */
@keyframes goldShine {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.text-gold {
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-shine), var(--color-gold-dark));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShine 3s linear infinite;
}

/* Particules flottantes sur l'écran d'auth */
.auth-particle {
  position: fixed;
  width: 4px; height: 4px;
  background: rgba(201,168,76,.4);
  border-radius: 50%;
  animation: floatUp 6s ease-in infinite;
  pointer-events: none;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: .6; }
  100% { transform: translateY(-100vh) scale(0); opacity: 0; }
}

/* Sidebar horse avatar luxe */
.sidebar-horse-name {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* delay-6 pour les stagger plus longs */
.delay-6 { animation-delay: 360ms; }

/* ═══════════════════════════════════════════════════════════
   LOGO — Intégration Équi Suivis
   ═══════════════════════════════════════════════════════════ */

/* ── Logo dans la sidebar ──────────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 4px 0;
}

.sidebar-logo-img {
  width: 180px;
  height: auto;
  display: block;
  /* Le PNG a déjà un fond vert sombre qui se fond dans la sidebar */
  border-radius: var(--radius-md);
  transition: transform 300ms ease, opacity 300ms ease;
}

.sidebar-logo-img:hover {
  transform: scale(1.03);
  opacity: .9;
}

/* Réduit la hauteur du header sidebar pour le logo */
.sidebar-header {
  padding: 12px 12px 10px !important;
}

/* ── Logo dans la top bar mobile ───────────────────────────── */
.top-bar-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar-logo-img {
  height: 42px;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* ── Logo sur l'écran d'authentification ───────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-img {
  width: 280px;
  max-width: 90%;
  height: auto;
  margin: 0 auto 12px;
  display: block;
  border-radius: var(--radius-lg);
  /* Légère ombre pour le décoller du fond de la card */
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: fadeInDown 500ms ease both;
}

.auth-logo-tagline {
  font-size: .875rem;
  color: var(--color-muted);
  font-style: italic;
  letter-spacing: .02em;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 320px) {
  .sidebar-logo-img { width: 140px; }
}

/* ═══════════════════════════════════════════════════════════
   MESSAGERIE D'ÉQUIPE — chat par cheval
   ═══════════════════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-beige);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--color-border);
  border-bottom: none;
}
.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 75%;
  animation: fadeInUp 200ms ease both;
}
.chat-bubble.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-bubble.mine .bubble-content {
  background: var(--color-forest);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}
.chat-bubble.theirs .bubble-content {
  background: #fff;
  color: var(--color-text);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  border: 1px solid var(--color-border);
}
.chat-bubble.alert .bubble-content {
  background: #fff3cd;
  border: 1px solid var(--color-warning);
  color: #856404;
}
.bubble-content {
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.bubble-author {
  font-size: .72rem;
  font-weight: 600;
  opacity: .75;
  margin-bottom: 3px;
}
.bubble-time {
  font-size: .68rem;
  opacity: .6;
  margin-top: 3px;
  text-align: right;
}
.bubble-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-beige);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-forest);
  flex-shrink: 0;
  align-self: flex-end;
}
.bubble-vet { color: var(--color-info); font-size: .7rem; }
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  align-items: flex-end;
}
.chat-input-bar textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}
.chat-date-separator {
  text-align: center;
  font-size: .72rem;
  color: var(--color-muted);
  margin: 8px 0;
  position: relative;
}
.chat-date-separator::before, .chat-date-separator::after {
  content: '';
  position: absolute;
  top: 50%; width: 35%;
  height: 1px; background: var(--color-border);
}
.chat-date-separator::before { left: 0; }
.chat-date-separator::after  { right: 0; }


/* ============================================================
   RESPONSIVE MOBILE
   Adaptation 320px → 480px. Ne modifie aucun style desktop.
   ============================================================ */

/* ── 1. Base tactile (mobile uniquement, sans effet sur desktop) ── */
@media (max-width: 767px) {
  button,
  .btn,
  .bottom-nav-item,
  .nav-item a,
  .hamburger-btn,
  .tab-btn,
  a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── 2. Layout général mobile (max-width: 480px) ── */
@media (max-width: 480px) {
  /* Main content padding réduit */
  .main-content { padding: 16px 12px !important; }

  /* Page header : titre et bouton l'un en dessous de l'autre si nécessaire */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header .btn { width: 100%; justify-content: center; }

  /* Stats grid : 2 colonnes sur mobile */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .stat-card { padding: 14px 10px; }
  .stat-value { font-size: 1.6rem !important; }

  /* Cards */
  .card-body { padding: 14px 12px; }
  .card-header { padding: 12px 14px; }

  /* Horses grid : 1 colonne sur mobile */
  .horses-grid { grid-template-columns: 1fr !important; }

  /* Tables : scroll horizontal */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  th, td { padding: 10px 10px; font-size: .82rem; }

  /* Modales : plein écran sur mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .modal-lg, .modal-sm {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92dvh;
  }
  .modal-header { padding: 16px 20px 12px; }
  .modal-body   { padding: 16px 20px; }
  .modal-footer { padding: 12px 20px 16px; flex-direction: column; }
  .modal-footer .btn { width: 100%; }

  /* Formulaires */
  .form-input, .form-select, .form-textarea { font-size: 16px !important; } /* évite zoom iOS */
  .flex.gap-3.flex-wrap { flex-direction: column; gap: 0; }

  /* Auth card */
  .auth-card { padding: 28px 20px; border-radius: var(--radius-xl); }
  .auth-logo-img { width: 220px !important; }

  /* Toast */
  .toast-container { bottom: 16px; right: 8px; left: 8px; width: auto; max-width: none; }

  /* Tabs : scroll horizontal */
  .tab-nav { gap: 0; }
  .tab-btn { padding: 10px 12px; font-size: .82rem; }

  /* Boutons en bas de fiche */
  .horse-card-actions { flex-wrap: wrap; }
  .horse-card-actions .btn { flex: 1; min-width: 120px; }

  /* Page title plus petit */
  .page-title { font-size: 1.3rem !important; }
  .page-title::after { width: 28px; }

  /* Horse detail hero plus petit */
  .horse-detail-hero { height: 160px !important; font-size: 3.5rem !important; }
  .horse-info-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Chat */
  .chat-container { height: calc(100dvh - 180px); }
  .chat-bubble { max-width: 88%; }

  /* Badges wrap */
  .flex.gap-2 { flex-wrap: wrap; }

  /* Selector bar */
  .horse-selector-bar { flex-direction: column; align-items: flex-start; }
  .horse-selector-bar .form-select { max-width: 100% !important; width: 100%; }

  /* Sidebar footer safe area iPhone */
  .sidebar-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

  /* Alert plein largeur */
  .alert { font-size: .82rem; }

  /* Timeline */
  .timeline-item { gap: 10px; }

  /* Membre card */
  .card-body.flex.items-center { flex-wrap: wrap; }
}

/* ── 3. Top bar mobile améliorée (max-width: 767px) ── */
@media (max-width: 767px) {
  .top-bar {
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
  }
  /* Bouton hamburger plus grand = plus facile à tapper */
  .hamburger-btn { font-size: 1.4rem; min-width: 48px; min-height: 48px; }
}

/* ── 4. Sidebar mobile améliorée (max-width: 767px) ── */
@media (max-width: 767px) {
  /* Sidebar en overlay pleine hauteur */
  #sidebar {
    width: min(280px, 85vw) !important;
  }
  /* Nav items plus grands pour le touch */
  .nav-item a {
    padding: 14px 20px;
    min-height: 52px;
    font-size: 1rem;
  }
  .nav-item-icon { font-size: 1.2rem; }

  /* Logo sidebar un peu plus petit */
  .sidebar-logo-img { width: 150px !important; }
}

/* ── 5. Bottom navigation bar sur mobile (optionnel mais très pro) ──
   Barre de navigation en bas à la façon app native, avec les 5
   sections les plus importantes. Elle remplace le top-bar-title sur mobile. */
.bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: var(--color-forest);
    border-top: 1px solid rgba(201,168,76,.25);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 150;
    box-shadow: 0 -4px 16px rgba(0,0,0,.2);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .6rem;
    font-weight: 500;
    padding: 6px 4px;
    min-height: 48px;
    transition: color 150ms ease;
    cursor: pointer;
    border: none;
    background: none;
  }
  .bottom-nav-item.active {
    color: var(--color-gold-light);
  }
  .bottom-nav-item:hover { color: #fff; }
  .bottom-nav-icon { font-size: 1.3rem; line-height: 1; }
  .bottom-nav-label { line-height: 1; letter-spacing: .02em; }

  /* Décale le contenu principal pour qu'il ne soit pas caché par la bottom nav */
  #main-wrapper {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}
/* Fin RESPONSIVE MOBILE */
