/* Mon espace — aligné sur les pages React (Tailwind-like) */

.companion-main {
  /* Équivalent Layout React : container py-4 md:py-8 (sous la nav fixe + promo) */
  padding-top: 1rem;
  padding-bottom: 2rem;
  max-width: 72rem;
}

@media (min-width: 768px) {
  .companion-main {
    padding-top: 2rem;
  }
}

.companion-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 16rem;
}

.companion-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--primary-200, #bae6fd);
  border-top-color: var(--primary-600, #0284c7);
  animation: companion-spin 0.9s linear infinite;
}

@keyframes companion-spin {
  to {
    transform: rotate(360deg);
  }
}

.companion-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 0.75rem;
  color: #4b5563;
  /* Pas de padding-top : le spacer nav (4rem) + padding du main suffisent (comme React). */
  margin-bottom: 1.125rem;
}

@media (min-width: 640px) {
  .companion-breadcrumb {
    font-size: 0.875rem;
  }
}

@media (min-width: 768px) {
  .companion-breadcrumb {
    margin-bottom: 1.5rem;
  }
}

.companion-breadcrumb a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.companion-breadcrumb a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.companion-breadcrumb a:hover {
  color: var(--primary-600, #0284c7);
}

.companion-breadcrumb__current {
  color: #111827;
  font-weight: 500;
}

.companion-breadcrumb > span[aria-hidden="true"] {
  color: #9ca3af;
  user-select: none;
}

.companion-head-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .companion-head-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.companion-h1 {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #111827;
}

.companion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.companion-btn--primary {
  background: var(--primary-600, #0284c7);
  color: #fff;
}

.companion-btn--primary:hover {
  background: var(--primary-700, #0369a1);
}

.companion-btn--secondary {
  background: #fff;
  color: var(--primary-600, #0284c7);
  border: 1px solid #e5e7eb;
}

.companion-btn--danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.companion-btn--danger:hover {
  background: #fef2f2;
}

.companion-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.companion-card:hover {
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}

.companion-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .companion-grid--pets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .companion-grid--pets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.companion-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

.companion-empty p {
  color: #4b5563;
  margin: 0 0 1rem;
}

.companion-msg {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.companion-msg--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.companion-msg--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.companion-form {
  max-width: 42rem;
  margin: 0 auto;
  background: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
}

.companion-field {
  margin-bottom: 1.25rem;
}

.companion-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.35rem;
}

.companion-field input,
.companion-field select,
.companion-field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
}

.companion-field textarea {
  min-height: 100px;
  resize: vertical;
}

.companion-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.companion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.companion-table th,
.companion-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.companion-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.companion-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--primary-50, #f0f9ff);
  color: var(--primary-700, #0369a1);
  border: 1px solid var(--primary-200, #bae6fd);
}

.companion-tag--muted {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.companion-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.companion-tab {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: #f3f4f6;
  color: #4b5563;
}

.companion-tab.is-active {
  background: var(--primary-600, #0284c7);
  color: #fff;
}

.companion-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.companion-modal {
  background: #fff;
  border-radius: 0.75rem;
  max-width: 28rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.15);
}

/* Cartes animaux */
.companion-pet-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
}

.companion-pet-photo {
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: #f3f4f6;
}

.companion-pet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.companion-pet-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.35;
}

.companion-pet-body {
  padding: 1.25rem;
}

.companion-pet-name {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.companion-pet-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.companion-pet-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
}

.companion-detail-head {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 640px) {
  .companion-detail-head {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  }
}

.companion-detail-hero {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 0.75rem;
  background: #f3f4f6;
}

.companion-detail-hero--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 4rem;
  opacity: 0.25;
}

.companion-detail-meta {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.companion-muted {
  color: #6b7280;
  font-size: 0.9375rem;
}

/* Actualités (connecté) — pilule type d’activité / soin : marron thème, texte blanc (comme ActusPage + capture) */
.actus-type-badge {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0.125rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: #fff;
  background-color: var(--primary-600, #63563d);
  max-width: 100%;
  word-break: break-word;
}
