/* ====== Reset básico ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, sans-serif;
}

/* ===================================================== */
/* ===================== LOGIN ========================= */
/* ===================================================== */

body.login-body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('../images/fondo.jpg') no-repeat center center;
  background-size: cover;
  filter: brightness(0.55);
  z-index: -1;
}

/* Contenedor centrado */
.login-wrapper {
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tarjeta del formulario */
.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  padding: 40px 35px;
  border-radius: 16px;
  border: 3px solid #1f5f2e;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  text-align: center;
  backdrop-filter: blur(6px);
}

/* Logo */
.login-logo {
  width: 85%;
  max-width: 240px;
  margin-bottom: 30px;
}

/* Inputs */
.input-field {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 8px;
  border: 2px solid #dcdcdc;
  font-size: 15px;
  transition: all 0.25s ease;
  outline: none;
}

.input-field:focus {
  border-color: #1f5f2e;
  box-shadow: 0 0 0 3px rgba(31, 95, 46, 0.15);
}

/* Botón */
.btn-login {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: none;
  background-color: #1f5f2e;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background-color: #174823;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Alertas */
.alert {
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.alert.error {
  background: #ffe5e5;
  border: 2px solid #b3261e;
  color: #7a1a14;
}

.alert.warning {
  background: #fff4e5;
  border: 2px solid #cc7a00;
  color: #8a5200;
}

.alert.success {
  background: #e6f4ea;
  border: 2px solid #1f5f2e;
  color: #1f5f2e;
}

.link-regresar,
.link-regresar:visited {
    color: var(--verde-principal);
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}


.link-regresar:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* ===================================================== */
/* ==================== DASHBOARD ====================== */
/* ===================================================== */

:root {
  --verde-principal: #1F5F2E;
  --verde-hover: #174823;
  --verde-acento: #2E8B57;
  --gris-texto: #4A4A4A;
  --fondo-dashboard: #F4F6F9;
  --blanco-card: #FFFFFF;
  --header-altura: 80px;
}

body.dashboard-body {
  background: #f4f6f9;
  padding: 40px;
}

/* Título */
.dashboard-title {
  color: var(--verde-principal);
  margin-top: var(--header-altura);
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 700;
}

/* Grid 12 columnas tipo Bootstrap */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 30px;
}

/* Clases de tamaño */
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }

/* Tarjetas */
.chart-card {
  background: var(--blanco-card);
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  border-left: 6px solid var(--verde-principal);
  transition: transform .25s ease, box-shadow .25s ease;

}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}


.chart-card canvas {
              /* top:0 right:0 bottom:0 left:0 */
  width: 95% !important;
  height: 90% !important;
}

/* Título de gráfica */
.chart-title {
  color: var(--gris-texto);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.chart-card {
  position: relative;
  height: 380px; 
   overflow: hidden;  /* altura real para la gráfica */
}

.chart-card.col-4 {
  position: relative;
  height: 280px; 
   overflow: hidden;  /* altura real para la gráfica */
}

.chart-card.col-3 {
  position: relative;
  height: 280px; 
   overflow: hidden;  /* altura real para la gráfica */
}

.chart-card.col-6 {
  position: relative;
  height: 380px; 
   overflow: hidden;  /* altura real para la gráfica */
}



.chart-card.col-12 {
  position: relative;
  height: 480px; 
   overflow: hidden;  /* altura real para la gráfica */
}
/* Responsive: en móvil todo ocupa la fila completa */
@media (max-width: 900px) {
  .col-12, .col-8, .col-6, .col-4, .col-3 {
    grid-column: span 12;
  }
}

/* Login responsive */
@media (max-width: 280px) {
  .login-card {
    padding: 30px 20px;
  }

  .login-logo {
    width: 100%;
  }
}

/* ===================================================== */
/* ==================== HEADER GLOBAL =================== */
/* ===================================================== */


/* Header fijo */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-altura);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-bottom: 4px solid var(--verde-principal);
  z-index: 1000;
}

/* Logo */
.header-logo {
  height: 55px;
}

/* Menú */
.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--gris-texto);
  font-weight: 600;
  font-size: 15px;
  transition: all .25s ease;
  padding: 8px 14px;
  border-radius: 6px;
}

.nav-menu a:hover {
  background: var(--verde-principal);
  color: #fff;
}

/* Para que el contenido no quede debajo del header */
.page-content {
  padding-top: calc(var(--header-altura) + 30px);
  padding-left: 40px;
  padding-right: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-header {
    padding: 0 20px;
  }

  .nav-menu {
    gap: 15px;
  }

  .header-logo {
    height: 45px;
  }

  .page-content {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ===================================================== */
/* =================== RESPONSIVE MENU ================= */
/* ===================================================== */

/* Asegurar alineación correcta del menú */
.nav-menu {
  display: flex;
  gap: 30px;
  align-items: center; /* 🔥 Alinea Inicio, Ordenes y Salir */
}

/* Botón hamburguesa */
.menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--verde-principal);
}

/* Dropdown contenedor */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Link principal "Ordenes" */
.nav-dropdown > a {
  text-decoration: none;
  color: var(--gris-texto);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all .25s ease;
}

.nav-dropdown > a:hover {
  background: var(--verde-principal);
  color: #fff;
}

/* Dropdown base */
.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  border-top: 3px solid var(--verde-principal);
  z-index: 999;
}

.dropdown-content a {
  display: block;
  padding: 12px 16px;
  color: var(--gris-texto);
  text-decoration: none;
  font-size: 14px;
  transition: all .2s ease;
}

.dropdown-content a:hover {
  background: var(--verde-principal);
  color: #ffffff;
}

/* Hover solo en desktop */
@media (min-width: 769px) {
  .nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* ===================== MÓVIL ===================== */

@media (max-width: 768px) {

  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: var(--header-altura);
    right: 0;
    background: #ffffff;
    flex-direction: column;
    width: 240px;
    padding: 25px;
    box-shadow: -5px 10px 25px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform .3s ease;
    gap: 20px;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-dropdown {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    display: none;
    width: 100%;
    margin-top: 5px;
  }

  .dropdown-content a {
    padding-left: 20px;
  }

  .dropdown-content.show {
    display: block;
  }

}

/*========== tablas ==========*/
.tabla-dashboard {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--blanco-card);
  font-size: 14px;
}

.tabla-dashboard th,
.tabla-dashboard td {
  border: 1.5px solid var(--verde-principal);
  padding: 6px 8px;
  text-align: center;
}

.tabla-dashboard thead th {
  background-color: var(--verde-principal);
  color: white;
  font-weight: bold;
}

.tabla-dashboard tbody td:first-child {
  font-weight: bold;
  color: var(--verde-principal);
}

.tabla-dashboard tfoot td {
  font-weight: bold;
  background-color: #e9f5ee;
}


/*========== tablas lit==========*/
.tabla-dashboard-lit {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--blanco-card);
  font-size: 12px;
}

.tabla-dashboard-lit th,
.tabla-dashboard-lit td {
  border: 1.5px solid var(--verde-principal);
  padding: 3px 4px;
  text-align: center;
}

.tabla-dashboard-lit thead th {
  background-color: var(--verde-principal);
  color: white;
  font-weight: bold;
}

.tabla-dashboard-lit tbody td:first-child {
  font-weight: bold;
  color: var(--verde-principal);
}

.tabla-dashboard-lit tfoot td {
  font-weight: bold;
  background-color: #e9f5ee;
}

/* =======   slector de fechas =========*/
.filtro-fechas {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 25px 0;
}

.btn-dashboard {
    background-color: var(--verde-principal);
    color: white;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 4px;
}

.btn-dashboard:hover {
    opacity: 0.9;
}
