
:root{
    ---principal: #2d5f2e ; 
    ---secundario: #ff8c42;
    ---sombra: #5a6d5a;
    ---terciario: #f0f4f0;
    ---blanco: #ffffff;
    ---oscuro: #000000;
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

body {
  background: linear-gradient(135deg, var(---terciario), #e9eeea);
}


/* LOGIN */

.volver {
  position: absolute;
  top: 20px;
  left: 20px;
  text-decoration: none;
  color: var(---principal);
  font-weight: 500;
  font-size: 14px;
  background: rgba(255,255,255,0.7);
  padding: 8px 14px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  transition: 0.3s;
}

.volver:hover {
  background: var(---secundario);
  color: var(---blanco);
  transform: translateY(-2px);
}


.login-container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  text-align: center;
}

.login-card h2 {
  margin-bottom: 20px;
  color: var(---principal);
}

.login-card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.login-card button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(---principal), #4caf50);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.login-card button:hover {
  transform: translateY(-2px);
}


/* LAYOUT ADMIN */


.layout {
  display: flex;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  height: 100vh;
  background: var(---principal);
  color: var(---blanco);
  padding: 25px;
  position: fixed;
}

.sidebar h2 {
  margin-bottom: 40px;
}

.sidebar a {
  display: block;
  padding: 12px;
  margin: 10px 0;
  color: var(---terciario);
  text-decoration: none;
  border-radius: 10px;
  transition: 0.3s;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.1);
}

/* CONTENT */
.content {
  margin-left: 240px; 
  width: calc(100% - 240px);
  padding: 30px;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 40px;
  background: var(---blanco);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user {
  background: var(---terciario);
  padding: 8px 15px;
  border-radius: 20px;
}


/* DASHBOARD CARDS */


.cards {
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: 25px;
  border-radius: 16px;
  transition: 0.3s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-6px);
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  color: var(---sombra);
}

.card a {
  display: inline-block;
  margin-top: 10px;
  color: var(---secundario);
  text-decoration: none;
  font-weight: bold;
}


/* BLOG ADMIN */



/* LAYOUT */
.layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR (SIN FIXED) */
.sidebar {
  width: 240px;
  background: var(---principal);
  color: var(---blanco);
  padding: 25px;
}

/* MENU */
.sidebar a {
  display: block;
  padding: 12px;
  margin: 10px 0;
  color: var(---terciario);
  text-decoration: none;
  border-radius: 10px;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255,255,255,0.1);
}

/* CONTENIDO */
.content {
  flex: 1; /* ocupa todo el espacio */
  padding: 30px;
  background: #f5f5f5;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.topbar h1 {
  font-size: 24px;
}

/* BOTON */
.btn-nuevo {
  background: var(---secundario);
  color: var(---blanco);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.btn-nuevo:hover {
  transform: translateY(-2px);
}

/* GRID */
.blog-grid-admin {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

/* CARD */
.blog-card-admin {
  background: var(---blanco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* IMG */
.blog-img-admin {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* INFO */
.blog-info-admin {
  padding: 15px;
}

/* BOTONES */
.blog-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.btn-editar {
  background: #2e7d32;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.btn-eliminar {
  background: #c62828;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.prod-btn-disable {
  background: var(---secundario);
  color: var(---blanco);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
}

.prod-btn-enable {
  background: var(---principal);
  color: var(---blanco);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
}

/* ALERTAS */


.alerta {
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: #e6f4ea;
  color: var(---principal);
}


/* =========================
   FORMULARIOS ADMIN (BLOG + PRODUCTOS)
========================= */

.form-container {
  display: flex;
  justify-content: center;
  padding: 60px 30px; 
  background: #f5f5f5;
  min-height: 100vh;
}

.form-card {
  width: 100%;
  max-width: 850px;
  padding: 45px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* TÍTULO */
.form-card h2 {
  margin-bottom: 25px;
  text-align: center;
  font-size: 26px;
  color: var(---principal);
}

/* GRUPOS */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #444;
}

/* INPUTS */
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  outline: none;
  transition: 0.3s;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(---principal);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* TEXAREA */
textarea {
  height: 120px;
  resize: none;
}

/* BOTÓN GUARDAR */
.btn-guardar {
  width: 100%;
  background: var(---principal);
  color: white;
  padding: 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

.btn-guardar:hover {
  transform: translateY(-2px);
}

/* VOLVER */
.btn-volver {

  text-decoration: none;
  color: var(---principal);
  font-weight: 500;
  font-size: 14px;
  background: rgba(255,255,255,0.7);
  padding: 8px 14px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  transition: 0.3s;
}

.btn-volver:hover {
  background: var(---secundario);
  color: var(---blanco);
  transform: translateY(-2px);
}

/* TABLA */

.prod-container {
  background: var(---blanco);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* HEADER */
.prod-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
}

.prod-header h2 {
  font-size: 24px;
}

/* BOTÓN NUEVO */
.prod-btn-nuevo {
  background: var(---secundario);
  color: var(---blanco);
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.prod-btn-nuevo:hover {
  transform: translateY(-2px);
}

/* =========================
   PRODUCTOS - ADMIN TABLE
========================= */

.prod-page {
  padding: 40px 30px; 
}

.prod-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
}

.prod-table th {
  background: var(---principal);
  color: white;
  text-align: left;
  padding: 12px;
}

.prod-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.prod-table tr:hover {
  background: #f9f9f9;
}

/* IMAGEN */
.prod-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
}

/* BOTONES */
.prod-actions {
  display: flex;
  gap: 8px;
}

.prod-btn-edit {
  background: #2e7d32;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}

.prod-btn-delete {
  background: #c62828;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}

/*Logout*/


/* MODAL FONDO */
.modal {
  display: none; /* oculto por defecto */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.5);

  justify-content: center;
  align-items: center;

}

/* ACTIVO */
.modal.active {
  opacity: 1;
  pointer-events: all;
}

/* CAJA */
.modal-box {
  background: var(---blanco);
  padding: 25px;
  border-radius: 14px;
  width: 320px;
  text-align: center;

  transform: scale(0.9);
  transition: 0.3s;
}

.modal.active .modal-box {
  transform: scale(1);
}

/* BOTONES */
.modal-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cancelar {
  flex: 1;
  background: #ccc;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.confirmar {
  flex: 1;
  background: var(---secundario);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* ANIMACIÓN SALIDA */
.fade-out {
  animation: fadeOut 0.4s forwards;
}

/* =========================
   STATS
========================= */

.stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:25px;
    margin:35px 0;
}

/* CARD */

.stat-card{
    position:relative;
    overflow:hidden;
    padding:28px;
    border-radius:24px;
    color:white;
    box-shadow:0 12px 25px rgba(0,0,0,0.08);
    transition:0.3s;
}

.stat-card:hover{
    transform:translateY(-6px);
}

/* COLORES */

.stat-green{
    background:linear-gradient(135deg,#2d5f2e,#4d8b4f);
}

.stat-orange{
    background:linear-gradient(135deg,#ff8c42,#ffb067);
}

.stat-blue{
    background:linear-gradient(135deg,#3b82f6,#60a5fa);
}

/* TOP */

.stat-top{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:25px;
}

.stat-icon{
    font-size:30px;
    background:rgba(255,255,255,0.2);
    width:55px;
    height:55px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:16px;
}

.stat-label{
    font-size:15px;
    font-weight:500;
    opacity:0.9;
}

/* NUMERO */

.stat-card h2{
    font-size:38px;
    margin:0;
    font-weight:700;
}

/* TEXTO */

.stat-card p{
    margin-top:14px;
    opacity:0.9;
    font-size:14px;
    line-height:1.5;
}

/* RESPONSIVE */

@media(max-width:900px){

    .stats{
        grid-template-columns:1fr;
    }

}

