/* ═══════════════════════════════════════════════════════════
   Panel de Administración — admin.mascotaencontrada.es
   ═══════════════════════════════════════════════════════════ */

:root {
  --marron:  #8B4513;
  --dorado:  #D4853A;
  --crema:   #F5E6D3;
  --verde:   #2E7D32;
  --rojo:    #DC2626;
  --azul:    #1E40AF;
  --gris:    #6B7280;
  --oscuro:  #1F2937;
  --fondo:   #F3F4F6;
  --blanco:  #FFFFFF;
  --sombra:  0 2px 8px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--fondo); color: var(--oscuro); min-height: 100vh; }

/* ── Layout */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* ── Sidebar */
.sidebar {
  background: var(--oscuro);
  padding: 1.5rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; font-weight: 700; font-size: 1rem;
  padding: .75rem 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1rem;
}
.sidebar-brand span { font-size: 1.4rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.65);
  padding: .65rem 1rem; border-radius: 8px;
  font-size: .9rem; margin-bottom: .2rem;
  transition: all .2s;
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.activo {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar nav a.activo { background: var(--marron); color: #fff; }

/* ── Main */
.admin-main { padding: 2rem; overflow-x: auto; }
.admin-header { margin-bottom: 1.75rem; }
.admin-header h1 { font-size: 1.5rem; color: var(--oscuro); }
.admin-header p  { color: var(--gris); font-size: .9rem; margin-top: .25rem; }

/* ── Cards de estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--blanco);
  border-radius: 12px; padding: 1.5rem;
  box-shadow: var(--sombra);
}
.stat-num  { font-size: 2rem; font-weight: 800; color: var(--marron); }
.stat-label { color: var(--gris); font-size: .85rem; margin-top: .25rem; }
.stat-card.verde .stat-num { color: var(--verde); }
.stat-card.azul  .stat-num { color: var(--azul); }
.stat-card.rojo  .stat-num { color: var(--rojo); }

/* ── Tabla admin */
.tabla-wrap { background: var(--blanco); border-radius: 12px; box-shadow: var(--sombra); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--fondo); color: var(--gris); padding: .75rem 1rem; text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td { padding: .85rem 1rem; border-bottom: 1px solid #F0F0F0; font-size: .9rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFA; }

/* ── Badges de estado */
.badge {
  padding: .2rem .65rem;
  border-radius: 50px;
  font-size: .78rem; font-weight: 600;
  display: inline-block; white-space: nowrap;
}
.badge-pendiente   { background: #fef3c7; color: #92400e; }
.badge-confirmado  { background: #dcfce7; color: #166534; }
.badge-preparacion { background: #dbeafe; color: #1e40af; }
.badge-enviado     { background: #ede9fe; color: #5b21b6; }
.badge-entregado   { background: #dcfce7; color: #166534; }
.badge-cancelado   { background: #fee2e2; color: #991b1b; }

/* ── Botones admin */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all .2s; text-decoration: none; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-primary  { background: var(--marron); color: #fff; border-color: var(--marron); }
.btn-primary:hover  { filter: brightness(1.15); color: #fff; }
.btn-success  { background: var(--verde); color: #fff; border-color: var(--verde); }
.btn-success:hover  { filter: brightness(1.1); color: #fff; }
.btn-danger   { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.btn-outline  { background: transparent; color: var(--marron); border-color: var(--marron); }
.btn-outline:hover { background: var(--marron); color: #fff; }
.btn-secondary { background: var(--fondo); color: var(--oscuro); border-color: #D1D5DB; }
.btn-secondary:hover { background: #E5E7EB; color: var(--oscuro); }

/* ── Formularios admin */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .3rem; color: var(--oscuro); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .6rem .9rem;
  border: 2px solid #E5E7EB; border-radius: 8px;
  font-size: .9rem; color: var(--oscuro);
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--marron); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Detail card */
.detail-card { background: var(--blanco); border-radius: 12px; padding: 1.5rem; box-shadow: var(--sombra); margin-bottom: 1.25rem; }
.detail-card h3 { font-size: 1rem; color: var(--marron); margin-bottom: 1rem; }
.detail-row { display: flex; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid #F3F4F6; font-size: .9rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--gris); min-width: 150px; font-size: .85rem; }
.detail-value { color: var(--oscuro); font-weight: 500; }

/* ── Flash */
.flash { padding: .9rem 1.25rem; border-radius: 10px; margin-bottom: 1.25rem; font-weight: 500; border: 1px solid transparent; }
.flash-ok    { background: #dcfce7; border-color: #86efac; color: #166534; }
.flash-error { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ── Login admin */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--oscuro); }
.admin-login-card { background: var(--blanco); border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.admin-login-card h1 { font-size: 1.5rem; color: var(--marron); margin-bottom: .4rem; }

/* ── Responsive */
@media (max-width:768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .admin-main { padding: 1.25rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
