html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ===========================================================
   Layout del panel (sidebar + contenido).
   Paleta neutra provisional: los colores definitivos del spa
   se ajustarán más adelante con variables CSS.
   =========================================================== */
:root {
  --sidebar-width: 250px;
  /* Paleta rosada "chic": degradado rosa, texto burdeos para contraste */
  --sidebar-bg: linear-gradient(180deg, #f7c5d9 0%, #ec9cc0 55%, #e283ad 100%);
  --sidebar-fg: #7a2748;
  --sidebar-fg-active: #ffffff;
  --sidebar-active-bg: #c64b85;
  --content-bg: #fff5f9;
}

body {
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.app-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #6e1f3e;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(110, 31, 62, .15);
}

.app-menu {
  padding: .5rem .5rem 1rem;
}

.app-menu .menu-section {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(110, 31, 62, .55);
  padding: .9rem .75rem .35rem;
}

/* Encabezados de sección colapsables (acordeón) */
.menu-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  color: rgba(110, 31, 62, .65);
  text-transform: uppercase;
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .06em;
  padding: .8rem .75rem .4rem;
  cursor: pointer;
}

.menu-group-header:hover { color: #6e1f3e; }

.menu-group-header .chevron {
  font-size: .7rem;
  transition: transform .2s ease;
}

.menu-group-header[aria-expanded="false"] .chevron { transform: rotate(-90deg); }

.app-menu .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--sidebar-fg);
  border-radius: .4rem;
  padding: .55rem .75rem;
  font-size: .92rem;
}

.app-menu .nav-link .menu-ico { width: 1.25rem; text-align: center; }

.app-menu .nav-link:hover {
  background: rgba(255, 255, 255, .45);
  color: #6e1f3e;
}

.app-menu .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-fg-active);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(198, 75, 133, .35);
}

.app-menu .nav-link.disabled {
  color: rgba(110, 31, 62, .4);
  cursor: not-allowed;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--content-bg);
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid #e6e8ef;
  padding: .6rem 1.25rem;
}

.app-content {
  padding: 1.5rem;
  flex: 1;
}

/* Fondo oscuro detrás del menú en móvil (para cerrarlo tocando afuera) */
.app-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1035;
}
.app-overlay.show { display: block; }

/* Responsive: el sidebar se oculta y se muestra con el botón ☰ */
@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed;
    z-index: 1040;
    height: 100%;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 2px 0 14px rgba(0, 0, 0, .25);
    overflow-y: auto;
  }
  .app-sidebar.open { transform: translateX(0); }

  /* Menos relleno y títulos más compactos en pantallas pequeñas */
  .app-content { padding: 1rem .9rem; }
  .app-topbar { padding: .5rem .9rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.25rem; }

  /* Botones de fila más cómodos para el dedo y que no se amontonen */
  .table td .btn, .table th .btn { margin-bottom: .15rem; }
}

/* El overlay solo tiene sentido en móvil; en escritorio nunca se ve */
@media (min-width: 768px) {
  .app-overlay { display: none !important; }
}

/* FullCalendar: que la barra de herramientas no se desborde en móvil */
@media (max-width: 575.98px) {
  .fc .fc-toolbar.fc-header-toolbar {
    flex-direction: column;
    gap: .4rem;
    align-items: stretch;
  }
  .fc .fc-toolbar-title { font-size: 1.05rem; text-align: center; }
  .fc .fc-button { padding: .25rem .5rem; font-size: .8rem; }
}

/* Impresión / PDF: ocultar menú y botones, mostrar solo el contenido */
.print-only { display: none; }
@media print {
  .app-sidebar, .app-topbar, .app-overlay, .no-print { display: none !important; }
  .app-main, .app-content, .app-shell { display: block !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .print-only { display: block !important; }
  .card { border: 0 !important; box-shadow: none !important; }
  a[href]:after { content: ""; }
}

/* ── Campana de solicitudes del portal ── */
#btnCampana { line-height: 1; }
.campana-activa {
    display: inline-block;
    animation: rp-campanear 2.4s ease-in-out infinite;
    transform-origin: 50% 10%;
}
@keyframes rp-campanear {
      0%, 70%, 100% { transform: rotate(0deg); }
    74% { transform: rotate(14deg); }
    78% { transform: rotate(-12deg); }
    82% { transform: rotate(9deg); }
    86% { transform: rotate(-6deg); }
    90% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
    .campana-activa { animation: none; }
}

/* ── Compras: el total se separa de los filtros con una línea
      (arriba en móvil, al costado desde pantallas grandes) ── */
.panel-total {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}
@media (min-width: 992px) {
    .panel-total {
        border-top: 0;
        border-left: 1px solid var(--bs-border-color);
        padding-top: 0;
        margin-top: 0;
        padding-left: 1.5rem;
    }
}
