/* Layout principal */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #f7dee2; /* color principal */
  border-right: 1px solid rgba(0,0,0,0.08);
}

.content-wrapper {
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1 1 auto;
}

/* Menú lateral */
.sidebar-menu .sidebar-link {
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-menu .sidebar-link:hover {
  background: #ffffff; /* hover blanco */
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.sidebar-menu .sidebar-link.active {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #f3cfd5;
}
.sidebar-menu .sidebar-link .bi { transition: transform 0.2s ease; }
.sidebar-menu .sidebar-link[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.sidebar-sublink {
  display: block;
  padding: 6px 12px;
  color: #212529;
  text-decoration: none;
  background: #ffffff;
  border-radius: 6px;
}
.sidebar-sublink:hover {
  text-decoration: underline;
}

@media (max-width: 991px) {
  .layout {
    grid-template-columns: 1fr; /* el contenido ocupa todo, el sidebar se vuelve flotante */
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1040; /* por encima del backdrop */
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
}

/* Encabezado de marca en el sidebar */
.sidebar .brand {
  background: #ffffff;
}
.sidebar .brand img {
  display: block;
  max-width: 100px;
  width: 100%;
}

/* Backdrop para móviles cuando el menú está abierto */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1030;
  display: none;
}
body.sidebar-open .sidebar-backdrop {
  display: block;
}

/* Fondo de la página */
body {
  background-color: #ffffff;
}

/* Tarjetas y secciones principales */
.card {
  border-color: rgba(0,0,0,0.06);
}
.btn-primary {
  background-color: #f7dee2;
  border-color: #f7dee2;
  color: #212529;
}
.btn-primary:hover {
  background-color: #f3cfd5;
  border-color: #f3cfd5;
}

/* Navbar/Header ajustes visuales */
.navbar {
  background-color: #ffffff !important;
}
.navbar .btn-outline-secondary {
  color: #212529;
  border-color: #f7dee2;
}
.navbar .btn-outline-secondary:hover {
  background-color: #f7dee2;
}

/* Fondo suave para páginas como el login */
.bg-soft-pink {
  background-image: linear-gradient(180deg, #fff 0%, #f7dee2 100%);
}

/* Tipografía y tarjetas más elegantes */
body, button, input, textarea {
  font-feature-settings: "kern" 1, "liga" 1;
}
.card {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.card .card-header {
  background-color: #ffffff;
}
#preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 2000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.preloader-logo {
  width: 96px;
  height: auto;
}
.preloader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #f3cfd5;
  border-top-color: #f7dee2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.preloader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }