:root {
  --primary: rgb(23,56,92);
  --secondary: rgba(23,56,92, 0.85);
  --bg: #f4f6f8;
  --white: #ffffff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
}

/* LAYOUT */
.layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--white);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;

  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar .logo img {
  max-width: 140px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.sidebar-link a {
  display: flex;
  align-items: center;      /* centra verticalmente */
  flex-direction: row ;
  gap: 12px;                /* espacio entre icono y texto */
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  color: #444;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.sidebar-link a svg {
  min-width: 20px;          /* evita que se deforme */
  fill: #444;
}

.sidebar-link a p {
  margin: 0;
  line-height: 1;
}

/* hover */
.sidebar-link a:hover {
  background: rgba(23, 56, 92, 0.1);
}

/* activo */
.sidebar-link.active a,
.sidebar-link a.active-link {
  background: rgba(23, 56, 92, 0.15);
  color: #17385c;
}

.sidebar-link.active a svg {
  fill: #17385c;
}

.separator-line {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.separator-line::before,
.separator-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.separator-line span {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}


.logout {
  display: flex;
  justify-content: center;
  text-decoration: none;
  margin-top: auto;
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px;
  padding-top: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* MAIN */
.main {
  flex: 1;
  padding: 25px;
}

/* TOP BAR */
.topbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topbar input {
  width: 300px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.header-container {
  display: flex;
  justify-content: right;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background-color: #f0f0f5;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: fit-content;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.profile-icon svg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #fff;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-name {
  font-weight: 500;
  color: #333;
  font-size: 16px;
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.number {
  font-size: 28px;
  color: var(--primary);
}

/* ACTIONS */
.actions {
  margin-top: 30px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}

.action-grid-button {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 15px;
  border-radius: var(--radius);
  cursor: pointer;
}

/* BOTTOM */
.bottom {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.box {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
}

.finance span {
  display: block;
  margin-top: 8px;
}


/* ----------- PAGINA DE RESERVAS -----------*/

/* HEADER */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-primary {
  background: rgb(23,56,92);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.export-data .btn-primary {
  margin-top: 10px;
}

/* FILTROS */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filters input,
.filters select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* TABLA */
.table-container {
  background: white;
  border-radius: 14px;
  overflow: hidden;
}

.reservas-table {
  width: 100%;
  border-collapse: collapse;
}

.reservas-table th {
  background: #f4f6f8;
  text-align: left;
  padding: 14px;
  font-size: 14px;
}

.reservas-table td {
  padding: 14px;
  border-top: 1px solid #eee;
  vertical-align: middle;
}

.reservas-table tr:hover {
  background: #fafafa;
}

.price {
  font-weight: bold;
  color: rgb(23,56,92);
}

/* ESTADOS */
.estado {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.estado-pendiente {
  background: #dedede;
  color: #30302f;
}

.estado-abonada {
  background: #fff3cd;
  color: #856404;
}

.estado-pagada {
  background: #d4edda;
  color: #155724;
}

.estado-cancelada {
  background: #f8d7da;
  color: #721c24;
}

/* ----------- MODAL VISUALIZACION RESERVAS -----------*/

:root {
  --primary: rgb(23,56,92);
  --secondary: rgba(23,56,92, 0.85);
  --bg: #f4f6f8;
  --white: #ffffff;
  --radius: 14px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: var(--white);
  margin: 10% auto;
  padding: 20px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}

.close {
  color: var(--primary);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--secondary);
}

.modal-body {
  margin-top: 10px;
}

.modal-body p {
  margin: 6px 0;
  line-height: 1.4;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-20px);}
  to {opacity: 1; transform: translateY(0);}
}


/* SKELETON TABLE DE RESERVAS */

/* ===============================
   SKELETON TABLE
================================ */
.skeleton-row td {
  padding: 16px;
}

.skeleton-box,
.skeleton-pill,
.skeleton-circle {
  background: linear-gradient(
    90deg,
    #eeeeee 25%,
    #f5f5f5 37%,
    #eeeeee 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* tamaños */
.w-20 { width: 20%; height: 14px; }
.w-40 { width: 40%; height: 14px; }
.w-50 { width: 50%; height: 16px; }
.w-60 { width: 60%; height: 16px; }
.w-70 { width: 70%; height: 16px; }
.w-80 { width: 80%; height: 16px; }

.mt-6 { margin-top: 6px; }

/* formas */
.skeleton-pill {
  width: 90px;
  height: 28px;
  border-radius: 999px;
}

.skeleton-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}


/* ALOJAMIENTOS */

.alojamientos-table {
  width: 100%;
  border-collapse: collapse;
}

.alojamientos-table th {
  background: #f4f6f8;
  text-align: left;
  padding: 14px;
  font-size: 14px;
}

.alojamientos-table td {
  padding: 14px;
  border-top: 1px solid #eee;
  vertical-align: middle;
}

.alojamientos-table tr:hover {
  background: #fafafa;
}





/* ===============================
   AGREGAR / EDITAR ALOJAMIENTO
================================ */

.form-container {
  background: var(--white);
  border-radius: var(--radius);
  padding: 35px 40px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* FORM GRID */
#formAlojamiento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 26px;
}

/* Campos completos */
#formAlojamiento textarea,
#formAlojamiento button {
  grid-column: span 2;
}

/* LABELS */
#formAlojamiento label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

/* INPUTS */
#formAlojamiento input,
#formAlojamiento select,
#formAlojamiento textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: var(--white);
  transition: all 0.2s ease;
}

#formAlojamiento textarea {
  resize: vertical;
  min-height: 90px;
}

/* FOCUS */
#formAlojamiento input:focus,
#formAlojamiento select:focus,
#formAlojamiento textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(23,56,92, 0.15);
}

/* BOTÓN GUARDAR */
#formAlojamiento .btn-primary {
  margin-top: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
}

/* BOTÓN VOLVER */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
  .form-container {
    padding: 25px 20px;
  }

  #formAlojamiento {
    grid-template-columns: 1fr;
  }

  #formAlojamiento textarea,
  #formAlojamiento button {
    grid-column: span 1;
  }
}

/* ===============================
   BLOQUE DE FOTOS ALOJAMIENTO
================================ */

.form-photos {
  grid-column: span 2;
  margin-top: 10px;
  padding: 20px;
  border: 1px dashed rgba(23,56,92,0.3);
  border-radius: var(--radius);
  background: #f9fbfd;
}

/* VISUALIZACION DE FOTOS */ 

.photo-preview,
.photo-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.photo-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
}

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

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

.form-photos h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--primary);
}

.photos-help {
  font-size: 13px;
  color: #555;
  margin-bottom: 15px;
}

.photo-group {
  margin-bottom: 14px;
}

.photo-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  display: block;
  margin-bottom: 6px;
}

.photo-label span {
  font-weight: 400;
  font-size: 12px;
  color: #777;
}

/* Input file limpio */
.form-photos input[type="file"] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--white);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .form-photos {
    grid-column: span 1;
  }
}


/* ===============================
   AGREGAR / EDITAR RESERVA
================================ */

#formReserva {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 26px;
}

/* Campos que ocupan todo el ancho */
#formReserva textarea,
#formReserva button {
  grid-column: span 2;
}

/* SELECT DE ALOJAMIENTO (primer campo) */
#formReserva select#alojamiento_id {
  grid-column: span 2;
}

/* LABELS */
#formReserva label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

/* INPUTS */
#formReserva input,
#formReserva select,
#formReserva textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: var(--white);
  transition: all 0.2s ease;
}

/* FOCUS */
#formReserva input:focus,
#formReserva select:focus,
#formReserva textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(23,56,92, 0.15);
}

/* BOTÓN */
#formReserva .btn-primary {
  margin-top: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
  #formReserva {
    grid-template-columns: 1fr;
  }

  #formReserva textarea,
  #formReserva button,
  #formReserva select#alojamiento_id {
    grid-column: span 1;
  }
}


/* ===============================
   CONTABILIDAD - ESTILOS
================================ */

/* Resumen contable */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0;
}

.summary-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.summary-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.summary-card p {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* Colores por tipo */
.summary-card.income p {
  color: #16a34a; /* verde */
}

.summary-card.taxes p {
  color: #dc2626; /* rojo */
}

.summary-card.net p {
  color: #2563eb; /* azul */
}

/* Gráfico */
.finance-chart {
  background: #ffffff;
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

.finance-chart-dashboard {
  background: #ffffff;
  border-radius: 14px;
  padding: 25px;
  margin-bottom: 30px;
}

.finance-chart h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.chart-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

/* Historial */
.finance-history {
  background: #ffffff;
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.finance-history h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Tabla */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: #f8fafc;
}

.table th {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.table td {
  padding: 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Tipo ingreso / gasto */
.table .ingreso {
  color: #16a34a;
  font-weight: 600;
}

.table .gasto {
  color: #dc2626;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
  .finance-summary {
    grid-template-columns: 1fr;
  }

  .chart-container {
    max-width: 100%;
  }
}



/* ===============================
   MODAL
================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.modal-ingreso,
.modal-gasto,
.modal-agregar-reserva,
.modal-agregar-alojamiento {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  animation: modalFade .25s ease;
}

@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #64748b;
}

.modal-body {
  padding: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}

.form-group input,
.form-group textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Helpers */
.hidden {
  display: none;
}

/* TABLA DE PRE-RESERVAS DEL DASHBOARD */ 

/* CONTENEDOR */
.box {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.tittle-table-reservas {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tittle-table-reservas a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
}

/* TABLA */
.tabla-reservas {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 14px;
}

/* CABECERA */
.tabla-reservas thead {
  background: #f8fafc;
}

.tabla-reservas th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

/* FILAS */
.tabla-reservas tbody tr {
  transition: background 0.2s ease, transform 0.1s ease;
}

.tabla-reservas tbody tr:hover {
  background: #f1f5f9;
}

/* CELDAS */
.tabla-reservas td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
  vertical-align: middle;
}

/* ÚLTIMA FILA SIN BORDE */
.tabla-reservas tbody tr:last-child td {
  border-bottom: none;
}

/* BOTÓN */
.btn-ver {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-ver:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-ver:active {
  transform: translateY(0);
}

/* TEXTO CENTRADO (MENSAJES) */
.tabla-reservas td[colspan] {
  text-align: center;
  padding: 20px;
  color: #6b7280;
  font-style: italic;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .tabla-reservas thead {
    display: none;
  }

  .tabla-reservas tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
  }

  .tabla-reservas td {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  .tabla-reservas td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #374151;
  }

  .tabla-reservas td:last-child {
    border-bottom: none;
    justify-content: flex-end;
  }
}
