/* Importar tipografía premium de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* Variables CSS para diseño de alta gama */
:root {
  --bg-color: #FAF8F5;          /* Crema suave y limpio */
  --card-bg: #FFFFFF;           /* Blanco puro para contraste */
  --primary: #722F37;           /* Vino Cabernet/Burgundy de acento */
  --primary-hover: #581C23;     /* Cabernet oscuro en hover */
  --text-dark: #2C2421;         /* Carbón oscuro cálido (marrón roble) */
  --text-muted: #6E625E;        /* Texto secundario */
  --border-light: #EAE3DB;      /* Borde crema sutil */
  --bg-hover: #F3ECE4;          /* Crema claro interactivo */
  --success: #3C6255;           /* Verde oliva elegante para stock */
  --error: #A84448;             /* Rojo apagado elegante para error */
  --shadow-sm: 0 2px 8px rgba(44, 36, 33, 0.04);
  --shadow-md: 0 8px 24px rgba(44, 36, 33, 0.06);
  --shadow-lg: 0 16px 40px rgba(44, 36, 33, 0.1);
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset y Estilos Básicos */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- HEADER / NAVEGACIÓN --- */
header {
  background-color: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.25rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-color);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: bold;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-text span {
  font-weight: 400;
  font-style: italic;
  color: var(--primary);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  color: var(--text-dark);
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary);
}

.cart-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--text-dark);
  transition: var(--transition);
}

.cart-icon-btn:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.cart-icon-btn svg {
  width: 24px;
  height: 24px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- BANNER DE BIENVENIDA --- */
.hero-section {
  text-align: center;
  padding: 4.5rem 1rem 3.5rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --- CONTROLES: BÚSQUEDA Y FILTROS --- */
.controls-container {
  max-width: 1200px;
  margin: 0 auto 2.5rem auto;
  padding: 0 5%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-size: 1rem;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  color: var(--text-dark);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted);
}

.filter-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.filter-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.2);
}

/* --- GRID DE PRODUCTOS --- */
.products-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5% 5rem 5%;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(114, 47, 55, 0.15);
}

.product-image-wrapper {
  aspect-ratio: 4 / 5;
  background-color: #F8F5F0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.5px;
}

.product-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
}

.product-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.product-price {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
}

.add-to-cart-btn {
  background-color: var(--bg-hover);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background-color: var(--primary);
  color: white;
  transform: rotate(90deg);
}

.out-of-stock-text {
  font-size: 0.85rem;
  color: var(--error);
  font-weight: 600;
}

/* --- SECCIÓN SIN PRODUCTOS --- */
.no-products {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.no-products svg {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  color: var(--border-light);
}

/* --- VENTANA MODAL (DETALLE DE PRODUCTO) --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 36, 33, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 800px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid var(--border-light);
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  z-index: 10;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.modal-image-side {
  background-color: #F8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

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

.modal-info-side {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-category {
  font-size: 0.85rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.modal-specs {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-spec-item strong {
  color: var(--text-dark);
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.modal-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.modal-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.2);
  transition: var(--transition);
}

.modal-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(114, 47, 55, 0.3);
}

.modal-btn:disabled {
  background-color: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 768px) {
  .modal-content {
    grid-template-columns: 1fr;
  }
  .modal-image-side {
    aspect-ratio: 1.5;
  }
  .modal-info-side {
    padding: 1.5rem;
  }
}

/* --- CARRITO DE COMPRAS DESPLEGABLE (SIMULADO) --- */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-light);
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.cart-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition);
}

.cart-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--primary);
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cart-empty-message {
  text-align: center;
  color: var(--text-muted);
  margin-top: 3rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-light);
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #F8F5F0;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.cart-item-price-qty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cart-item-price-qty span {
  color: var(--primary);
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.cart-item-remove:hover {
  color: var(--error);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-color);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.cart-total-price {
  color: var(--primary);
  font-size: 1.3rem;
}

.cart-payment-note {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.checkout-btn {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.15);
}

.checkout-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(114, 47, 55, 0.25);
}

/* --- OVERLAY DE FONDO --- */
.cart-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 36, 33, 0.2);
  backdrop-filter: blur(4px);
  z-index: 120;
}

.cart-overlay.active {
  display: block;
}

/* --- FOOTER --- */
footer {
  border-top: 1px solid var(--border-light);
  background-color: var(--card-bg);
  padding: 3rem 5% 2rem 5%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.footer-logo span {
  color: var(--primary);
  font-style: italic;
  font-weight: 400;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary);
}

/* --- PANEL DE ADMINISTRACIÓN / INICIO DE SESIÓN --- */
.admin-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 5%;
  min-height: 70vh;
}

/* Formulario de Login */
.login-card {
  max-width: 420px;
  margin: 5rem auto;
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.login-card h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-card p {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.1);
}

.login-btn {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  margin-top: 1rem;
}

.login-btn:hover {
  background-color: var(--primary-hover);
}

.error-message {
  background-color: rgba(168, 68, 72, 0.08);
  border: 1px solid rgba(168, 68, 72, 0.2);
  color: var(--error);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  text-align: center;
  display: none;
}

/* Panel Admin Dashboard */
.admin-dashboard {
  display: none; /* Se activa dinámicamente */
  flex-direction: column;
  gap: 2rem;
}

.admin-dashboard.active {
  display: flex;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
}

.admin-header-actions {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

/* Tabla de Productos Admin */
.table-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.admin-table th, .admin-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  background-color: var(--bg-color);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background-color: rgba(250, 248, 245, 0.5);
}

.table-product-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.table-product-img {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #F8F5F0;
}

.table-product-name {
  font-weight: 600;
  color: var(--text-dark);
}

.table-price {
  font-weight: 600;
  color: var(--primary);
}

.table-stock-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.table-stock-badge.in-stock {
  background-color: rgba(60, 98, 85, 0.08);
  color: var(--success);
}

.table-stock-badge.low-stock {
  background-color: rgba(168, 68, 72, 0.08);
  color: var(--error);
}

.order-items-list {
  margin: 0;
  padding-left: 1.25rem;
}

.order-items-list li + li {
  margin-top: 0.35rem;
}

.order-status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background-color: rgba(114, 47, 55, 0.08);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.order-cancel-btn {
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
}

.order-cancel-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.action-btn.edit {
  color: var(--text-muted);
}

.action-btn.edit:hover {
  color: var(--primary);
  background-color: rgba(114, 47, 55, 0.06);
}

.action-btn.delete {
  color: var(--text-muted);
}

.action-btn.delete:hover {
  color: var(--error);
  background-color: rgba(168, 68, 72, 0.06);
}

/* Modal Formulario */
.form-modal-content {
  max-width: 600px;
  display: block; /* Normal flow */
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
}

.form-body {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background-color: var(--bg-color);
}

/* Toast de Notificaciones */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--text-dark);
  color: white;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background-color: var(--success);
}

.toast.error {
  background-color: var(--error);
}

.report-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.report-toolbar label {
  font-weight: 600;
}

.report-toolbar select {
  max-width: 240px;
}

.report-toolbar .btn-secondary {
  margin-left: auto;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.report-stat {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.report-stat p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.report-stat strong {
  color: var(--primary);
  font-size: 1.5rem;
}

.report-section {
  margin-top: 1.75rem;
}

.report-section h2 {
  margin-bottom: 0.85rem;
  font-size: 1.1rem;
}

.forecast-note {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.forecast-status {
  margin: 0.75rem 0 1.25rem;
  color: var(--text-muted);
}

.report-table-container {
  overflow-x: auto;
}

.report-table-container .admin-table {
  min-width: 520px;
}

/* Responsive general */
@media (max-width: 768px) {
  header {
    padding: 1rem 5%;
  }
  .logo-text {
    font-size: 1.5rem;
  }
  nav {
    gap: 1rem;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-header-actions {
    width: 100%;
  }
  .admin-header-actions button {
    flex-grow: 1;
    justify-content: center;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .tab-container {
    flex-wrap: wrap;
  }
  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .report-toolbar select {
    max-width: none;
  }
  .report-toolbar .btn-secondary {
    margin-left: 0;
  }
  .report-summary {
    grid-template-columns: 1fr;
  }
}

/* --- ESTILOS DE PESTAÑAS (TABS) ADMIN --- */
.tab-container {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}
