/* =========================================
   CONFIGURACION GENERAL
========================================= */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::selection {
  color: #ffffff;
  background: var(--lj-accent);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--lj-text);
  /* Fondo del sitio: degradados azules y grises animados (ver body::before). */
  background-color: var(--lj-app-bg);
}

html.index-protected body,
html.login-protected body {
  visibility: hidden;
}

html.index-protected.auth-ok body,
html.login-protected.auth-ok body {
  visibility: visible;
}

a { color: var(--lj-accent); }

/* =========================================
   MODAL OVERLAY SPINNER
========================================= */
.modal-local-overlay {
  position: absolute;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lj-overlay);
}

.modal-local-overlay-card {
  width: 96px;
  height: 96px;
  border-radius: var(--lj-radius-lg);
  border: 1px solid var(--lj-border);
  background: var(--lj-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-local-overlay .meta-spinner-login {
  width: 52px;
  height: 52px;
}

/* =========================================
   LAYOUT BASE
========================================= */
.app-shell,
.view {
  min-height: 100vh;
}

.view {
  width: 100%;
}

.view-app {
  display: flex;
  flex-direction: column;
}

.contenido {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

/* =========================================
   ENCABEZADO
========================================= */
.lj-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 max(16px, calc((100% - 1200px) / 2));
  background: var(--lj-surface);
  border-bottom: 1px solid var(--lj-border);
}

.lj-header-brand,
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lj-brand);
  text-decoration: none;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-brand-logo {
  width: 40px;
  height: auto;
  object-fit: cover;
}

.topbar-brand-text,
.lj-footer-title {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--lj-brand);
  white-space: nowrap;
}

/* Marca: "La" liviano y "Jamonera" en negrita, igual en encabezado, pie y login. */
.topbar-brand-text .brand-light,
.lj-footer-title .brand-light { font-weight: 400; }
.topbar-brand-text .brand-bold,
.lj-footer-title .brand-bold { font-weight: 800; }

.topbar-brand-text {
  font-size: 1.3rem;
}

.lj-header-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
  flex: 1;
}

.lj-header-link {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--lj-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
}

.lj-header-link:hover {
  color: var(--lj-text);
}

.lj-header-link > i {
  margin-right: 8px;
  font-size: 13px;
  width: 15px;
  text-align: center;
  opacity: .75;
}

.lj-header-link:hover > i,
.lj-header-link.is-active > i {
  opacity: 1;
}

.lj-header-link.is-active {
  color: var(--lj-accent);
  font-weight: 600;
  border-bottom-color: var(--lj-accent);
}

.lj-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.lj-theme-toggle {
  font-size: 18px;
  color: var(--lj-muted);
}

.lj-header-burger {
  display: none;
  font-size: 22px;
  color: var(--lj-text);
}

.topbar-user-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lj-accent-soft);
  border: 1px solid var(--lj-border-strong);
}

.topbar-user-initials {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--lj-accent);
  text-transform: uppercase;
}

.lj-user-menu-panel {
  min-width: 230px;
  padding: 12px;
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.topbar-user-name {
  margin: 0 0 10px;
  color: var(--lj-muted);
  font-size: 13px;
}

.topbar-user-name strong { color: var(--lj-text); }

.lj-drawer-nav {
  display: grid;
  gap: 2px;
}

.lj-drawer-nav .lj-header-link {
  height: 44px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  font-size: 15px;
}

.lj-drawer-nav .lj-header-link.is-active {
  border-left-color: var(--lj-accent);
  background: var(--lj-accent-soft);
}

@media (max-width: 991.98px) {
  .lj-header { gap: 12px; }
  .lj-header-nav { display: none; }
  .lj-header-burger { display: inline-flex; }
}

.barra-vertical {
  display: inline-block;
  width: 1px;
  height: 32px;
  margin: 0 8px;
  vertical-align: middle;
  background: var(--lj-border);
}

.barra-separadora {
  display: inline-block;
  width: 1px;
  height: 32px;
  margin: 0 8px;
  vertical-align: middle;
  background: var(--lj-border);
}

.ingredientes-print-thumb-fit {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
  padding: 5px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.ingredientes-toolbar-separator {
  margin: 0 6px;
  height: 34px;
}

.produccion-toolbar-icon-btn {
  width: fit-content;
}

#ingredientesModal .family-circle-thumb img,
#ingredientesModal .ingrediente-avatar img {
  width: 100%;
  height: 100%;
  object-position: center;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.inventario-filter-helper {
  color: var(--lj-warning);
  text-align: center;
  background-color: var(--lj-warning-soft);
  padding: 4px 8px;
  border-radius: var(--lj-radius);
}

.email-user {
  font-size: 0.6rem;
  color: var(--lj-muted);
}

/* =========================================
   CONTENIDO HOME
========================================= */
.header-content {
  border-radius: var(--lj-radius-lg) var(--lj-radius-lg) 0 0;
  background: var(--lj-surface);
  border: 1px solid var(--lj-border);
  padding: 12px;
  width: 100%;
  margin: 0 auto;
}

.home-content {
  border-radius: 0 0 var(--lj-radius-lg) var(--lj-radius-lg);
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  border-top: none;
  padding: 12px;
  width: 100%;
  margin: 0 auto;
  min-height: 50vh;
}

.home-title {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.home-text {
  margin-bottom: 0;
  color: var(--lj-muted);
}


/* =========================================
   FOOTER
========================================= */
.lj-footer {
  margin-top: 32px;
  background: var(--lj-surface);
  border-top: 1px solid var(--lj-border);
  color: var(--lj-text);
}

.lj-footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.lj-footer-col {
  display: grid;
  align-content: start;
  gap: 10px;
}

.lj-footer-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lj-footer-logo {
  width: 44px;
  height: auto;
  object-fit: contain;
}

.lj-footer-title {
  margin: 0;
  font-size: 1.2rem;
}

.lj-footer-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--lj-muted);
}

.lj-footer-text {
  margin: 0;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lj-muted);
}

.lj-footer-heading {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lj-muted);
}

.lj-footer-links {
  list-style: none;
  display: grid;
  gap: 2px;
}

.lj-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  font-size: 14px;
  font-weight: 500;
  color: var(--lj-text);
  text-decoration: none;
}

.lj-footer-links a i {
  width: 16px;
  text-align: center;
  color: var(--lj-muted);
}

.lj-footer-links a:hover,
.lj-footer-links a:hover i {
  color: var(--lj-accent);
}

.lj-footer-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--lj-muted);
  background: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius);
}

.lj-footer-session sl-icon { color: var(--lj-accent); }

.lj-footer-session strong {
  color: var(--lj-text);
  font-variant-numeric: tabular-nums;
}

.lj-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lj-footer-support i { color: #25d366; font-size: 15px; }

.lj-footer-bottom {
  border-top: 1px solid var(--lj-border);
  background: var(--lj-surface-2);
}

.lj-footer-bottom p {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--lj-muted);
}

.lj-footer-copy {
  padding-top: 12px;
}

.lj-footer-legal {
  padding: 2px 0 14px;
  font-size: 11px !important;
}

.lj-footer-bottom a {
  color: var(--lj-accent);
  font-weight: 600;
  text-decoration: none;
}

.lj-footer-bottom a:hover { text-decoration: underline; }

.lj-footer-mail {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
  font-size: 14px;
}

@media (max-width: 767.98px) {
  .lj-footer-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px 0 18px;
  }

  .lj-footer-actions sl-button { flex: 1 1 0; }
}

/* "Software de Ninja Soft" en el pie */
.lj-footer-bottom .lj-footer-maker,
.lj-footer-maker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  font-size: 12px;
  color: var(--lj-muted);
}
.lj-footer-maker img { height: 18px; width: auto; }
.lj-footer-maker .ns-dark { display: none; }
.sl-theme-dark .lj-footer-maker .ns-light { display: none; }
.sl-theme-dark .lj-footer-maker .ns-dark { display: inline; }

/* Franja inferior del pie oscura (claro y oscuro), con texto claro. */
.lj-footer-bottom {
  --footer-ink: rgba(255, 255, 255, .72);
  border-top: 0;
  background: #1c2434;
}
.sl-theme-dark .lj-footer-bottom { background: #0a0d12; border-top: 1px solid var(--lj-border); }
.lj-footer-bottom p,
.lj-footer-bottom .lj-footer-maker { color: var(--footer-ink); }
.lj-footer-bottom a { color: #fff; }
.lj-footer-bottom .lj-footer-mail { color: #fff; }
.lj-footer-bottom .lj-footer-maker .ns-light { display: none; }
.lj-footer-bottom .lj-footer-maker .ns-dark { display: inline; }
.lj-footer-bottom .lj-footer-legal { color: rgba(255, 255, 255, .55); }
.lj-footer-public .lj-footer-inner { grid-template-columns: 1fr; }


/* ===== Fondo del sitio: degradados azules y grises con movimiento lento =====
   Capa fija detrás del contenido; se anima con transform (GPU), no con background-position.
   El login conserva el cuadriculado fino. */
html:not(.login-protected) body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 18% 22%, var(--lj-app-blob-1) 0%, transparent 70%),
    radial-gradient(34% 40% at 82% 18%, var(--lj-app-blob-2) 0%, transparent 70%),
    radial-gradient(40% 46% at 70% 82%, var(--lj-app-blob-3) 0%, transparent 70%),
    radial-gradient(36% 40% at 22% 78%, var(--lj-app-blob-4) 0%, transparent 70%);
  animation: lj-app-bg-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes lj-app-bg-drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(-3%, 4%, 0) rotate(-6deg) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.login-protected) body::before { animation: none; }
}

/* Login: cuadriculado fino sobre piedra. */
html.login-protected body {
  background-color: var(--lj-bg);
  background-image:
    linear-gradient(var(--lj-bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--lj-bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

/* El color base va en <html>; el body queda transparente para que la capa animada (z-index -1) se vea. */
html:not(.login-protected) { background: var(--lj-app-bg); }
html:not(.login-protected) body { background: transparent; }
