/* ============================================
   PetManager - Estilos Principales
   Estética: Orgánica / Natural / Warm
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --green-deep:   #1a472a;
  --green-mid:    #2d6a4f;
  --green-light:  #52b788;
  --green-pale:   #d8f3dc;
  --green-mist:   #f0faf2;
  --amber:        #e76f51;
  --amber-light:  #f4a261;
  --cream:        #fefae0;
  --sand:         #f5f0e8;
  --text-dark:    #1c2b1e;
  --text-mid:     #3d5142;
  --text-light:   #7a9b82;
  --white:        #ffffff;
  --shadow-sm:    0 2px 8px rgba(26,71,42,.08);
  --shadow-md:    0 4px 20px rgba(26,71,42,.12);
  --shadow-lg:    0 8px 40px rgba(26,71,42,.16);
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    22px;
  --radius-xl:    32px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sand);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAVBAR ── */
.navbar {
  background: var(--green-deep);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.navbar-brand .paw { font-size: 26px; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: #95d5b2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 50px;
  transition: all .2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}

.navbar-nav .btn-nav-admin {
  background: var(--green-light);
  color: var(--white);
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
}

.navbar-nav .btn-nav-admin:hover {
  background: var(--white);
  color: var(--green-deep);
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, #40916c 100%);
  padding: 80px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2395d5b2' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; max-width: 700px; margin: 0 auto; }

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 60px);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  color: #95d5b2;
  font-size: 18px;
  max-width: 500px;
  margin: 0 auto 32px;
}

/* ── SEARCH CODE BOX ── */
.code-search-box {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  margin: 0 auto;
}

.code-search-box h3 {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-search-box .input-row {
  display: flex;
  gap: 10px;
}

.code-search-box input {
  flex: 1;
  padding: 13px 18px;
  border: none;
  border-radius: 50px;
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: none;
  background: var(--white);
  color: var(--green-deep);
}

.code-search-box input::placeholder { color: #aaa; font-weight: 400; letter-spacing: 0; }

/* ── CONTAINER ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── SECTION ── */
.section { padding: 60px 0; }
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  color: var(--green-deep);
  margin-bottom: 8px;
}
.section-sub { color: var(--text-light); margin-bottom: 36px; }

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── PET CARD ── */
.pet-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}

.pet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pet-card-img {
  height: 200px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  position: relative;
  overflow: hidden;
}

.pet-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-card-img .badge-estado {
  position: absolute;
  top: 12px;
  right: 12px;
}

.pet-card-body { padding: 20px; flex: 1; }

.pet-card-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--green-deep);
  font-weight: 700;
  margin-bottom: 4px;
}

.pet-card-meta {
  color: var(--text-light);
  font-size: 13px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pet-card-desc {
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pet-card-code {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-light);
  background: var(--sand);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 14px;
}

.pet-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sand);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 5px 12px;
  border-radius: 50px;
}

.badge-hogar   { background: #e8f5e9; color: #2e7d32; }
.badge-perdido { background: #fff3e0; color: #e65100; }
.badge-adopcion{ background: #e3f2fd; color: #1565c0; }
.badge-leido   { background: var(--sand); color: var(--text-light); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-primary {
  background: var(--green-light);
  color: var(--white);
  border-color: var(--green-light);
}
.btn-primary:hover { background: var(--green-mid); border-color: var(--green-mid); }

.btn-outline {
  background: transparent;
  color: var(--green-light);
  border-color: var(--green-light);
}
.btn-outline:hover { background: var(--green-light); color: var(--white); }

.btn-danger {
  background: #e74c3c;
  color: var(--white);
  border-color: #e74c3c;
}
.btn-danger:hover { background: #c0392b; border-color: #c0392b; }

.btn-amber {
  background: var(--amber);
  color: var(--white);
  border-color: var(--amber);
}
.btn-amber:hover { background: #c85a3e; border-color: #c85a3e; }

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #d0ddd2;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(82,183,136,.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── CARD / PANEL ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  color: var(--green-deep);
}

.card-body { padding: 28px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--green-mist);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f4f0;
  color: var(--text-mid);
  font-size: 14px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--green-mist); }

/* ── ALERT / FLASH ── */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .icon { font-size: 52px; }

.login-logo h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  color: var(--green-deep);
  margin-top: 8px;
}

.login-logo p { color: var(--text-light); font-size: 14px; }

/* ── ADMIN LAYOUT ── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

.sidebar {
  width: 240px;
  background: var(--green-deep);
  flex-shrink: 0;
  padding: 28px 0;
}

.sidebar-title {
  color: #52b788;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 24px;
  margin-bottom: 12px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: #95d5b2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border-left-color: var(--green-light);
}

.sidebar-nav .icon { font-size: 18px; width: 22px; }

.admin-main { flex: 1; padding: 36px; background: var(--sand); overflow-x: hidden; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.admin-topbar h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  color: var(--green-deep);
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.green  { background: var(--green-pale); }
.stat-icon.orange { background: #fff3e0; }
.stat-icon.blue   { background: #e3f2fd; }
.stat-icon.red    { background: #fce4ec; }

.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--green-deep);
  line-height: 1;
}

.stat-label { color: var(--text-light); font-size: 13px; margin-top: 4px; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}

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

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--sand);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--green-deep);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text-dark); }

.modal-body { padding: 24px 28px 28px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 22px; color: var(--text-mid); margin-bottom: 8px; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  align-items: center;
}

.filter-bar select, .filter-bar input {
  padding: 9px 16px;
  border: 1.5px solid #d0ddd2;
  border-radius: 50px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--green-light);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 16px 0; }
  .admin-main { padding: 20px 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar {
    padding: 0 15px;
    height: auto;
    padding-bottom: 15px;
    flex-direction: column; /* Apila el logo y los links */
  }
  .navbar-brand {
    margin-top: 10px;
  }
  .navbar-nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .navbar-nav a {
    font-size: 12px;
    padding: 6px 10px;
  }
/* -Hero- */  
  .hero {
    padding: 40px 20px;
  }
  .code-search-box .input-row {
    flex-direction: column; /* El input y el botón uno sobre otro */
  }
  .code-search-box input {
    text-align: center;
    letter-spacing: 1px;
  }
  
  
}




/* ── MISC ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.foto-preview-wrap {
  width: 100%;
  height: 160px;
  border: 2px dashed #c8dbc8;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-light);
  background: var(--green-mist);
  margin-bottom: 10px;
  overflow: hidden;
}
.foto-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
