:root {
  --primario: #16529c;    /* Azul fuerte cabecera calendario */
  --secundario: #14a159;  /* Verde para botones y detalles */
  --libre: #eafbf1;       /* Verde claro días libres */
  --ocupada: #ffe5e5;     /* Rojo suave ocupados */
  --gris: #f3f3f3;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: var(--gris);
  background-image: url('fondo.jpg'); /* Cambia el fondo si quieres */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #f1f6fc, #e8f3ff);
  box-shadow: 0 2px 8px rgba(0,70,173,0.08);
  border-bottom: 1px solid #e0e5f4;
  display:flex;justify-content:space-between;align-items:center;
  padding: 10px 5vw;
  font-size: 16px;
  box-sizing: border-box;
}
.logo img {
  height:40px;max-width:200px;transition:transform 0.2s;
}
.logo img:hover { transform: scale(1.05);}
@media (max-width: 900px) {
  .logo img { max-width: 100px; height: 28px; }
}
@media (max-width: 600px) {
  .logo img { max-width: 80px; height: 22px; }
}

/* TABLA CALENDARIO */
table {
  margin: 12px auto;
  border-radius: 16px;
  border-collapse: separate;
  border-spacing: 0;
  overflow-x: auto;
  width: 98vw;
  max-width: 800px;
  background: #fff;
  box-shadow: 0 3px 15px #ccc5;
  min-width: 600px; /* scroll lateral si hace falta */
}
th {
  background: var(--primario);
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 15px;
}
th.col-dia {
  background: #16529c;
  color: #fff;
}
td {
  color: #222; /* Oscuro y legible en todos los modos */
  font-size: 15px;
}
/* Columna habitaciones */
td:first-child {
  background: #ffd60a;
  color: #003787;
  font-weight: bold;
  border-right: 2px solid #fff;
  font-size: 16px;
}
/* Días ocupados/libres */
.ocupada {
  background: var(--ocupada);
  color: #b22428;
  font-weight: bold;
  border-bottom: 2px solid #fff;
}
.libre {
  background: var(--libre);
  color: #16529c;
  border-bottom: 2px solid #fff;
}
button, .mes-btn {
  background: var(--secundario);
  color: #fff;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  padding: 7px 20px;
  box-shadow: 0 2px 8px #14a15944;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover, .mes-btn:hover {
  background: #0c8351;
  color: #fff;
}
.mes-btn {
  text-decoration: none;
  color: var(--primario); 
  background: var(--gris); 
  border-radius: 8px;
  padding: 4px 10px;
  border: 2px solid #e0e5f4;
  font-weight: bold;
}
.mes-btn:hover { background: var(--secundario); color: #fff; border: 2px solid var(--secundario);}
.mes-btn-hoy {
  background: #ffd60a !important;
  color: #003787 !important;
  border: 2px solid #ffd60a !important;
  font-weight: bold;
  box-shadow: 0 1px 6px #ffd60a33;
  font-size: 15px !important;
  padding: 7px 18px !important;
  margin-top: 12px!important;
}
.mes-btn-hoy:hover {
  background: #fff39a !important;
  color: #003787 !important;
}

/* FORMULARIO MODAL RESERVA Y EDITAR */
#formulario, #formularioEditar { 
  position: fixed; z-index: 101; top: 0; left: 0;
  height: 100vh; width: 100vw; background: #0007; display: flex; 
  justify-content: center; align-items: center; transition: all 0.2s;
}
#formulario form, #formularioEditar form { 
  padding: 30px 16px 22px 16px; background: #fff; border-radius: 15px;
  box-shadow: 0 5px 20px #0046ad55; min-width: 240px; width: 90vw; max-width: 400px; 
  display: flex; flex-direction: column; gap: 18px;
}
#formulario input[type="text"], #formularioEditar input[type="text"],
#formulario input[type="number"], #formularioEditar input[type="number"] { 
    border: 1px solid #eee; border-radius: 7px; padding: 9px; font-size: 16px; outline: none;
}

/* LOGIN BOX */
.login-box {
  background: #fff;
  padding: 28px 16px 18px 16px;
  border-radius: 16px;
  box-shadow: 0 6px 24px #3332;
  max-width: 350px;
  width: 94vw;
  margin: 50px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-box h2 {
  font-size: 19px;
  margin-bottom: 8px;
  color: #003787;
  text-align: center;
}
.login-box label {
  font-size: 15px;
  margin: 10px 0 3px 2px;
  color: #16529c;
}
.login-box input[type="text"], 
.login-box input[type="password"] {
  border: 1px solid #eee;
  border-radius: 7px;
  padding: 10px;
  font-size: 16px;
  width: 100%;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.login-box button[type="submit"] {
  background: #14a159;
  color: #fff;
  border: none;
  border-radius: 22px;
  font-weight: 600;
  padding: 10px 0;
  font-size: 17px;
  margin-top: 8px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 2px 8px #14a15944;
  transition: background 0.2s;
}
.login-box button:hover {
  background: #0c8351;
}
.login-box .info {
  margin-top: 10px;
  font-size: 13px;
  color: #888;
  text-align: center;
}

/* ICONO WhatsApp */
.whatsapp-icon img {
  transition: transform 0.15s;
}
.whatsapp-icon:hover img {
  transform: scale(1.15);
}

/* ESTADÍSTICAS PANEL ADMIN */
.stats-card {
  background:#fff;
  padding:20px;
  border-radius:12px;
  box-shadow:0 3px 10px rgba(0,0,0,0.06);
  margin:15px 0;
}
.progress-bar {
  background:#e0e5f4;
  border-radius:10px;
  height:20px;
  position:relative;
  overflow:hidden;
}
.progress-fill {
  background:linear-gradient(90deg,#0046ad,#4dccff);
  height:100%;
  border-radius:10px;
  transition:width 0.3s;
}
canvas { max-width: 100vw; }


/* RESPONSIVE */
@media (max-width: 900px) {
  #formulario form, #formularioEditar form {
    width: 98vw;
    max-width: 98vw;
  }
  th, td {
    padding: 7px 1px;
    font-size: 12px;
  }
  table {
    min-width: 500px;
    font-size: 13px;
  }
  .logo img {
    max-width: 100px;
    height: 28px;
  }
}

@media (max-width: 700px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 95vw;
    min-width: 350px;
    background: #fff;
    margin: 10px auto;
  }
}
@media (max-width: 600px) {
  table, th, td { font-size: 12px; }
  h2 { font-size: 17px; }
  header { font-size: 14px; }
  .logo img { max-width: 80px; }
  table { font-size: 12px; min-width: 350px; }
  button, .mes-btn { font-size: 12px; padding: 7px 8px; }
  .login-box {
    margin: 18px auto;
    padding: 18px 6vw 15px 6vw;
    max-width: 98vw;
  }
  .login-box h2 { font-size: 16px;}
  .login-box input, .login-box button { font-size: 14px; }
}

.login-wrapper {
  min-height: 100vh;
  background: var(--gris);
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-box {
  background: #fff;
  padding: 28px 18px 22px 18px;
  border-radius: 16px;
  box-shadow: 0 6px 24px #00378715;
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto;
}
.login-box h2 {
  font-size: 20px;
  margin-bottom: 7px;
  color: #003787;
  text-align: center;
}
.login-box label {
  font-size: 15px;
  color: #16529c;
  font-weight: 600;
  margin: 9px 0 3px 0;
}
.login-box input[type="text"], 
.login-box input[type="password"] {
  border: 1px solid #eee;
  border-radius: 7px;
  padding: 11px;
  font-size: 16px;
  width: 100%;
  margin-bottom: 12px;
  box-sizing: border-box;
  background: #f6fbff;
}
.login-box button[type="submit"] {
  background: #14a159;
  color: #fff;
  border: none;
  border-radius: 22px;
  font-weight: 600;
  padding: 12px 0;
  font-size: 17px;
  margin-top: 2px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 2px 8px #14a15940;
  transition: background 0.2s;
}
.login-box button[type="submit"]:hover {
  background: #0c8351;
}
.login-box .info {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
  text-align: center;
}
.login-error {
  color: #b22428;
  background: #ffe5e5;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 500px) {
  .login-box {
    max-width: 95vw;
    padding: 16px 8vw;
    border-radius: 10px;
  }
  .login-box h2 { font-size: 16px;}
  .login-box input, .login-box button { font-size: 15px;}
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}
.login-logo img {
  max-width: 200px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 12px #00378716;
}
@media (max-width: 500px) {
  .login-logo img {
    max-width: 72px;
  }
}

/* === PANEL DE ESTADÍSTICAS === */
.stats-container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #f1f6fc, #e8f3ff);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,70,173,0.08);
}

.stats-title {
  color: #16529c;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.month-selector {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Resumen de estadísticas */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.summary-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-align: center;
  border-left: 4px solid var(--color);
}

.summary-card.total { --color: #16529c; }
.summary-card.ocupacion { --color: #14a159; }
.summary-card.ingresos { --color: #ffd60a; }

.summary-number {
  font-size: 32px;
  font-weight: bold;
  color: var(--color);
  margin-bottom: 5px;
}

.summary-label {
  color: #666;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabla mejorada */
.table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.table-header {
  background: #16529c;
  color: white;
  padding: 15px 20px;
  font-size: 18px;
  font-weight: 600;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: 15px 12px;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
  vertical-align: top;
}

.stats-table tbody tr:hover {
  background-color: rgba(22, 82, 156, 0.05);
}

.habitacion-nombre {
  font-weight: 600;
  color: #16529c;
}

.reservas-count {
  background: #e8f5e8;
  color: #2d5a2d;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 40px;
  display: inline-block;
}

.fechas-detalle {
  font-size: 12px;
  line-height: 1.4;
  color: #555;
  max-width: 250px;
}

.comentarios-texto {
  font-size: 12px;
  line-height: 1.4;
  color: #666;
  font-style: italic;
  max-width: 200px;
}

.precio-total {
  font-weight: bold;
  color: #14a159;
  font-size: 16px;
}

.no-data {
  color: #999;
  font-style: italic;
}

@media (max-width: 768px) {
  .stats-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .stats-summary {
    grid-template-columns: 1fr;
  }
  
  .stats-table th,
  .stats-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* Contenedor central del calendario */
.calendar-container {
  max-width: 1100px;
  margin: 30px auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 20px #00378710;
  padding: 18px 10px;
}

/* Cabecera moderna del calendario */
.calendar-header {
  background: linear-gradient(90deg, #e1efff 80%, #fff 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 5vw;
  border-radius: 12px 12px 0 0;
  margin-bottom: 15px;
  box-shadow: 0 3px 12px #0046ad10;
}
.calendar-title {
  font-size: 30px;
  font-weight: 700;
  color: #16529c;
  letter-spacing: 1px;
}

.resumen-mes {
  display: flex;
  gap: 2vw;
  justify-content: center;
  margin: 18px 0 10px 0;
  flex-wrap: wrap;
}
.resumen-item {
  background: #f1f6fc;
  box-shadow: 0 2px 8px #00378708;
  border-radius: 10px;
  padding: 15px 28px;
  color: #222;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  min-width: 180px;
  border-left: 6px solid var(--color, #16529c);
}
.resumen-item.reservas { --color: #14a159; }
.resumen-item.ocupacion { --color: #ffd60a;}
.resumen-item.ingresos { --color: #16529c;}

@media (max-width:600px){
  .calendar-title{font-size:20px}
  .calendar-header{padding: 10px 2vw;}
  .resumen-item{font-size: 15px; padding: 9px 8px;}
}

/* Fila de colores alternos por habitación */
.habitacion-row:nth-child(1n) { background: #ffece6;}
.habitacion-row:nth-child(2n) { background: #eafbf1;}
.habitacion-row:nth-child(3n) { background: #e7edfa;}
.habitacion-row:nth-child(4n) { background: #fffbe6;}
.habitacion-row:nth-child(5n) { background: #ede7fa;}
.habitacion-row:nth-child(6n) { background: #e5f7ff;}
.habitacion-row:nth-child(7n) { background: #fff0e5;}

/* Tooltips para ocupada */
.ocupada[title] {
  position: relative;
  cursor: pointer;
}
.ocupada[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%; top: 110%;
  transform: translateX(-50%);
  background: #16529c;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  min-width: 175px;
  font-size: 15px;
  box-shadow: 0 3px 15px #00378722;
  white-space: pre-line;
  z-index: 999;
  pointer-events: none;
}

/* Día actual resaltado */
th.hoy, td.hoy {
  background: #ffd60a!important;
  color: #003787!important;
  border: 2px solid #ffd60a;
}

/* Responsive tabla */
@media (max-width:900px) {
  .calendar-container{padding: 3px;}
  table{min-width:340px;}
}


