/* ===== Custom styles to complement Tailwind ===== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --green: #2d6a4f;
  --green-dark: #1b4332;
  --green-light: #52b788;
  --white: #f9f6f0;
  --brown: #8b5e3c;
  --brown-light: #a97c5b;
  --gold: #c9a84c;
  --gold-light: #e2c47e;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--white);
  color: #2c2c2c;
}

h1, h2, h3, .font-display {
  font-family: 'Playfair Display', serif;
}

/* ===== Navbar ===== */
.navbar {
  background: var(--green-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover {
  color: var(--gold-light);
  background: rgba(255,255,255,0.07);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-slideshow {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
  filter: brightness(0.45);
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity, transform;
}
.hero-slide.active {
  opacity: 1;
}

/* Fallback gradient when no images are loaded yet */
#hero-bg-fallback {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 2rem;
}

.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.82);
  margin-bottom: 2rem;
  font-weight: 300;
}

.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.45);
}

/* ===== Trust badges ===== */
.trust-strip {
  background: var(--green);
  padding: 1.1rem 1rem;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.92);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ===== Section ===== */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 2.5rem;
  border-radius: 99px;
}

/* ===== Filters ===== */
.filter-bar {
  background: #fff;
  border: 1px solid #e5e0d6;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.filter-group select,
.filter-group input {
  border: 1.5px solid #ddd6cb;
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  color: #333;
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--green);
}

.btn-reset {
  padding: 0.45rem 1.1rem;
  background: #f0ebe3;
  border: 1.5px solid #ddd6cb;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--brown);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-reset:hover { background: #e5ddd2; }

/* ===== Sheep Card ===== */
.sheep-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
}
.sheep-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(45,106,79,0.15);
}

.sheep-card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e8e2d8;
}
.sheep-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.sheep-card:hover .sheep-card-img-wrap img {
  transform: scale(1.06);
}

.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.status-disponible { background: rgba(37,211,102,0.88); color: #fff; }
.status-reserve { background: rgba(255,159,28,0.9); color: #fff; }
.status-vendu { background: rgba(220,53,69,0.9); color: #fff; }

.sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sold-overlay span {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid #fff;
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  transform: rotate(-12deg);
}

.sheep-card-body {
  padding: 1.1rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sheep-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
}
.sheep-race {
  font-size: 0.78rem;
  color: var(--brown-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheep-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.83rem;
  color: #666;
}
.sheep-meta span { display: flex; align-items: center; gap: 3px; }

.sheep-desc {
  font-size: 0.83rem;
  color: #555;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sheep-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 0.3rem;
}
.sheep-price small {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #888;
}

.btn-wa-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  font-weight: 600;
  font-size: 0.87rem;
  padding: 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 0.75rem;
  transition: background 0.2s;
}
.btn-wa-card:hover { background: #1ebe5d; }

/* No results */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: #888;
  grid-column: 1/-1;
}

/* ===== Footer ===== */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
}
.footer a { color: var(--gold-light); text-decoration: none; }
.footer a:hover { color: #fff; }
.footer-title {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* ===== Admin ===== */
.admin-body {
  background: #f4f1ec;
  min-height: 100vh;
}

.admin-navbar {
  background: var(--green-dark);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-left: 4px solid var(--green);
}
.stat-card.reserved { border-color: #f59e0b; }
.stat-card.sold { border-color: #ef4444; }
.stat-card.total { border-color: var(--brown); }

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
}

.admin-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  margin-bottom: 1.5rem;
}
.admin-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0ebe3;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.form-input {
  width: 100%;
  border: 1.5px solid #ddd6cb;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: #333;
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.btn-submit {
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-submit:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: #dc2626; }

.btn-edit {
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-edit:hover { background: var(--gold-light); }

/* Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.admin-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: #f8f4ee;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brown);
  border-bottom: 2px solid #ede8df;
}
.admin-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #f0ebe3;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #faf8f4; }

.table-thumb {
  width: 52px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8e2d8;
}

/* Login */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.shake { animation: shake 0.45s ease; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.active .modal-box { transform: scale(1); }

/* CSV preview */
.csv-preview-table {
  font-size: 0.8rem;
  width: 100%;
  overflow-x: auto;
  display: block;
}
.csv-preview-table th,
.csv-preview-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e5e0d6;
  white-space: nowrap;
}
.csv-preview-table th { background: #f8f4ee; font-weight: 600; }

/* ===== Carousel (homepage) ===== */
.carousel {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e8e2d8;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
}
.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.carousel-btn:hover { background: rgba(0,0,0,0.65); }
.carousel-btn.prev { left: 6px; }
.carousel-btn.next { right: 6px; }
.carousel-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

/* ===== Media gallery (admin) ===== */
.media-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.media-thumb {
  position: relative;
  width: 90px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e0d6;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.15s;
}
.media-thumb:hover { border-color: var(--green); transform: scale(1.04); }
.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-thumb .del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(220,53,69,0.9);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.media-thumb .video-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 3px;
}
.media-drop-zone {
  border: 2px dashed #c9b99a;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  color: #a08060;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 8px;
}
.media-drop-zone:hover,
.media-drop-zone.dragover {
  border-color: var(--green);
  background: rgba(45,106,79,0.05);
  color: var(--green);
}
.upload-progress {
  font-size: 0.8rem;
  color: var(--green);
  margin-top: 6px;
  display: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0ebe3; }
::-webkit-scrollbar-thumb { background: var(--green-light); border-radius: 99px; }

/* ===== Carousel — click-to-open lightbox ===== */
.carousel { cursor: zoom-in; }
.carousel-btn { cursor: pointer; }  /* keep pointer on buttons */

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-inner img,
.lightbox-inner video {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  background: none;
  border: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 99px;
}

/* ===== Hero entrance animations ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-anim-1,
.hero-anim-2,
.hero-anim-3,
.hero-anim-4 {
  opacity: 0;
  animation: fadeSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-anim-1 { animation-delay: 0.1s; }
.hero-anim-2 { animation-delay: 0.28s; }
.hero-anim-3 { animation-delay: 0.46s; }
.hero-anim-4 { animation-delay: 0.64s; }

/* Parallax will-change already on .hero-slide */

/* ===== Navbar scroll effect ===== */
.navbar {
  transition: padding 0.3s, box-shadow 0.3s, background 0.3s;
}
.navbar.scrolled {
  background: rgba(27, 67, 50, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.navbar.scrolled .max-w-7xl { height: 52px; }

/* ===== Skeleton loading ===== */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #ede8df 25%, #f8f4ee 50%, #ede8df 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.sk-img  { height: 220px; border-radius: 0; }
.sk-body { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.sk-line { height: 14px; }
.sk-sm   { height: 11px; }

/* ===== Scroll-triggered card entrance ===== */
.sheep-card {
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}
.sheep-card.card-hidden {
  opacity: 0;
  transform: translateY(28px);
  animation: none; /* override the CSS animation */
}
.sheep-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gold accent bar on card hover */
.sheep-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  border-radius: 0 0 14px 14px;
}
.sheep-card { position: relative; }
.sheep-card:hover::after { transform: scaleX(1); }

/* ===== Settings panel (admin) ===== */
.settings-panel {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}
.settings-panel.open {
  max-height: 1200px;
  opacity: 1;
}

.hero-drop-zone {
  border: 2px dashed #c9b99a;
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  color: #a08060;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 8px;
}
.hero-drop-zone:hover,
.hero-drop-zone.dragover {
  border-color: var(--green);
  background: rgba(45,106,79,0.05);
  color: var(--green);
}

/* Responsive helpers */
@media (max-width: 640px) {
  .filter-bar { flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-group select, .filter-group input { width: 100%; }
}

/* ===== Admin Pro Layout ===== */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: 100vh;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.admin-main {
  margin-left: 240px;
  min-height: 100vh;
  background: #f0ede7;
  padding: 1.75rem;
}

.admin-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 150;
  background: #fff;
  border-bottom: 1px solid #e5e0d6;
  padding: 0.75rem 1rem;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.32);
  padding: 0.65rem 0.5rem 0.25rem;
  text-transform: uppercase;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 8px;
  color: rgba(255,255,255,0.62);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  line-height: 1.2;
}
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-item.active {
  background: rgba(201,168,76,0.18);
  color: var(--gold-light);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--green-dark);
  font-size: 0.67rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.22); color: #fecaca; }

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  padding: 0.25rem;
}

/* ===== Stats grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card-pro {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 3px solid var(--green);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

/* ===== Admin page header ===== */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.2;
}

/* ===== Secondary button ===== */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #ddd6cb;
  color: var(--brown);
  font-weight: 600;
  font-size: 0.87rem;
  padding: 0.62rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: #f8f4ee; border-color: var(--brown-light); }

/* ===== Toast notifications ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.87rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 320px;
  animation: toastIn 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
  pointer-events: all;
  border-left: 4px solid #4b5563;
}
.toast.success { border-left-color: #22c55e; }
.toast.error   { border-left-color: #ef4444; }
.toast.info    { border-left-color: var(--gold); }

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

/* ===== Inline status select ===== */
.status-select {
  border: none;
  border-radius: 20px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  padding-right: 22px;
  outline: none;
  transition: opacity 0.15s;
}
.status-select:hover { opacity: 0.85; }
.status-select.status-disponible { background-color: rgba(37,211,102,0.88); color: #fff; }
.status-select.status-reserve    { background-color: rgba(255,159,28,0.9);  color: #fff; }
.status-select.status-vendu      { background-color: rgba(220,53,69,0.9);   color: #fff; }

/* ===== Recent sheep list ===== */
.recent-sheep-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0ebe3;
}
.recent-sheep-row:last-child { border-bottom: none; }
.recent-sheep-thumb {
  width: 44px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8e2d8;
  flex-shrink: 0;
}

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.3); }
  .admin-main { margin-left: 0; padding: 1rem; padding-top: 0; }
  .admin-topbar { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}
