/* ==========================================================================
   SSRPME · Estilos base compartidos
   ========================================================================== */

:root {
  --spp-primary: #93000b;
  --spp-surface: #fcf9f8;
  --spp-radius: 0.5rem;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main > :first-child {
  margin-top: 0 !important;
}

main > :last-child {
  margin-bottom: 0 !important;
}

/* Ocultamos la barra de scroll manteniendo el desplazamiento */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

* {
  scrollbar-width: none;
}

/* Iconos Material Symbols */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

/* Utilidades propias */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sliders de la rúbrica */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 9999px;
  background: #f0eded;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #93000b;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #93000b;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* Inputs de hora en modo lectura */
input[type="time"]:disabled {
  background-color: #eae7e7;
  cursor: not-allowed;
}

/* Animación de entrada para contenido generado */
@keyframes spp-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spp-fade-up {
  animation: spp-fade-up 0.28s ease-out both;
}

/* Toasts */
#toast-root {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 3rem));
}

.spp-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: #303030;
  color: #f3f0ef;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  animation: spp-toast-in 0.25s ease-out both;
}

.spp-toast[data-type="error"] .spp-toast__icon {
  color: #ffb4ab;
}

.spp-toast[data-type="success"] .spp-toast__icon {
  color: #ffcdc7;
}

@keyframes spp-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spp-toast.is-leaving {
  animation: spp-toast-out 0.22s ease-in both;
}

@keyframes spp-toast-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Tablas sin bordes externos */
.spp-table th {
  white-space: nowrap;
}

/* Enlaces de navegación activos y focos visibles */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #93000b;
  outline-offset: 2px;
}

/* Impresión: solo el área útil */
@media print {
  body {
    background: #ffffff !important;
  }

  #sidebar,
  #topbar,
  #toast-root,
  [data-no-print],
  .spp-no-print {
    display: none !important;
  }

  .lg\:pl-64 {
    padding-left: 0 !important;
  }

  main {
    padding: 0 !important;
  }

  .spp-print-surface {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
