/* LexSuite — Manual · estilo */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink: #ff74f3;
  --pink-dark: #e050d0;
  --pink-wash: rgba(255, 116, 243, 0.08);

  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  --font: 'Poppins', system-ui, -apple-system, sans-serif;
  --sidebar-w: 280px;
  --header-h: 64px;
  --content-max: 820px;
}

html { font-family: var(--font); font-size: 15.5px; color: var(--slate-800); background: var(--slate-50); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { min-height: 100vh; }

a { color: var(--pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: #fff; border-right: 1px solid var(--slate-200);
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.sidebar__brand {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; gap: 12px;
}
.sidebar__brand svg { width: 32px; height: 32px; }
.sidebar__brand span { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.sidebar__brand em { font-style: normal; color: var(--pink); }

/* ── Animated LexSuite hex logo (ported from the app's HexLogo) ── */
.brand-hex { overflow: visible; filter: drop-shadow(0 0 7px rgba(255,116,243,0.6)); }
@keyframes lex-pop {
  0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes lex-draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
.brand-hex .tri-mnl {
  transform-box: fill-box; transform-origin: 50% 50%; opacity: 0;
  animation: lex-pop 0.26s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.brand-hex .tri-mnl-0 { animation-delay: 0s; }
.brand-hex .tri-mnl-1 { animation-delay: 0.16s; }
.brand-hex .tri-mnl-2 { animation-delay: 0.32s; }
.brand-hex .tri-mnl-3 { animation-delay: 0.48s; }
.brand-hex .tri-mnl-4 { animation-delay: 0.64s; }
.brand-hex .tri-mnl-5 { animation-delay: 0.80s; }
.brand-hex .xcut-mnl {
  stroke-dasharray: 260; stroke-dashoffset: 260;
  animation: lex-draw 0.51s cubic-bezier(0.65,0,0.35,1) 0.99s forwards;
}
.brand-hex .xcut-mnl-b { animation-delay: 1.22s; }
/* Gentle glow pulse after the assembly finishes */
@keyframes lex-glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(255,116,243,0.45)); }
  50%      { filter: drop-shadow(0 0 11px rgba(255,116,243,0.85)); }
}
.brand-hex { animation: lex-glow 3s ease-in-out 1.6s infinite; }

.sidebar__meta { padding: 14px 24px 4px; font-size: 0.7rem; color: var(--slate-400); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }

.sidebar__nav { padding: 0 14px 28px; }
.sidebar__nav a {
  display: block; padding: 7px 12px; margin: 1px 0;
  color: var(--slate-600); font-size: 0.875rem; font-weight: 500;
  border-radius: 8px; border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.sidebar__nav a:hover { background: var(--slate-50); color: var(--slate-800); text-decoration: none; }
.sidebar__nav a.active { background: var(--pink-wash); color: var(--slate-900); border-left-color: var(--pink); }

.sidebar__nav .group {
  font-size: 0.6875rem; color: var(--slate-400); letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 700;
  padding: 18px 12px 6px; margin-top: 4px;
}

/* ── Main ── */
.main { min-width: 0; }

.header {
  position: sticky; top: 0; z-index: 5;
  height: var(--header-h);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.header__title { font-size: 0.9rem; color: var(--slate-500); font-weight: 500; }

.toggles { display: flex; gap: 10px; align-items: center; }
.toggle {
  display: inline-flex; background: #fff; border: 1px solid var(--slate-200);
  border-radius: 999px; padding: 3px; font-size: 0.8125rem;
}
.toggle button {
  background: none; border: none; cursor: pointer; padding: 6px 14px;
  border-radius: 999px; color: var(--slate-500); font-weight: 600; font-size: 0.8125rem;
  font-family: var(--font); transition: all 0.15s ease;
}
.toggle button.on { background: var(--slate-900); color: #fff; }
.toggle button.on.role-admin { background: var(--pink); }
.toggle button.on.role-empleado { background: var(--info); }

/* ── Content ── */
.content { padding: 48px 32px 80px; }
.content__inner { max-width: var(--content-max); }

h1.hero { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; color: var(--slate-900); margin-bottom: 10px; }
h1.hero em { font-style: italic; color: var(--pink); font-weight: 600; }
.lead { font-size: 1.0625rem; color: var(--slate-500); max-width: 640px; line-height: 1.6; margin-bottom: 40px; }

.section {
  scroll-margin-top: calc(var(--header-h) + 20px);
  padding: 42px 0 16px;
  border-bottom: 1px solid var(--slate-100);
}
.section:last-child { border-bottom: none; }
.section h2 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; color: var(--slate-900); margin-bottom: 8px; }
.section h2 small { font-size: 0.75rem; font-weight: 600; background: var(--pink-wash); color: var(--pink-dark); padding: 3px 10px; border-radius: 999px; vertical-align: middle; margin-left: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
.section h3 { font-size: 1.1rem; font-weight: 600; color: var(--slate-800); margin: 28px 0 10px; }
.section h4 { font-size: 0.9375rem; font-weight: 600; color: var(--slate-700); margin: 18px 0 8px; }
.section p { color: var(--slate-600); line-height: 1.7; margin-bottom: 14px; max-width: 720px; }
.section ul, .section ol { color: var(--slate-600); line-height: 1.65; margin: 8px 0 14px 20px; }
.section ul li, .section ol li { margin-bottom: 4px; }
.section code { background: var(--slate-100); color: var(--slate-800); padding: 1px 6px; border-radius: 4px; font-size: 0.85em; font-family: ui-monospace, 'SF Mono', monospace; }

/* ── Screenshot ── */
figure.shot {
  margin: 22px 0; background: #fff; border: 1px solid var(--slate-200);
  border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
figure.shot img {
  display: block; width: 100%; height: auto; background: var(--slate-100);
}
figure.shot img.missing, figure.shot img:not([src]), figure.shot img[src=""] {
  min-height: 280px;
}
figure.shot figcaption {
  padding: 10px 16px; border-top: 1px solid var(--slate-100);
  font-size: 0.8125rem; color: var(--slate-500); background: var(--slate-50);
}
figure.shot figcaption code { font-size: 0.78em; }

/* Placeholder cuando la imagen no carga */
figure.shot.pending {
  background: repeating-linear-gradient(45deg, var(--slate-50), var(--slate-50) 10px, var(--slate-100) 10px, var(--slate-100) 20px);
  border-style: dashed;
  min-height: 240px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 40px 24px; text-align: center;
}
figure.shot.pending::before {
  content: '📸 Captura pendiente';
  font-size: 0.95rem; color: var(--slate-500); font-weight: 600; margin-bottom: 8px;
}
figure.shot.pending figcaption { background: transparent; border: none; margin-top: 8px; }

/* ── Callouts ── */
.callout {
  padding: 14px 18px; border-radius: 10px; margin: 18px 0;
  border-left: 3px solid var(--info); background: rgba(59,130,246,.06);
  font-size: 0.9rem; color: var(--slate-700); line-height: 1.55;
}
.callout.warn { border-left-color: var(--warning); background: rgba(245,158,11,.08); }
.callout.danger { border-left-color: var(--error); background: rgba(239,68,68,.08); }
.callout.ok { border-left-color: var(--success); background: rgba(16,185,129,.08); }
.callout strong { color: var(--slate-900); }

/* ── Rol toggle: oculta contenido no seleccionado ── */
body[data-role="admin"] [data-role="empleado"] { display: none; }
body[data-role="empleado"] [data-role="admin"] { display: none; }

/* ── Idioma toggle ── */
body[data-lang="es"] [lang="en"] { display: none; }
body[data-lang="en"] [lang="es"] { display: none; }

/* Dentro de un mismo párrafo, ocultar spans del otro idioma */
[lang] { display: revert; }

/* ── Misc ── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag { font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--slate-100); color: var(--slate-600); letter-spacing: 0.04em; text-transform: uppercase; }
.tag.pink { background: var(--pink-wash); color: var(--pink-dark); }
.tag.blue { background: rgba(59,130,246,.12); color: #1d4ed8; }
.tag.warn { background: rgba(245,158,11,.15); color: #92400e; }

details { margin: 16px 0; border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; }
details summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--slate-800); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--slate-400); transition: transform 0.2s; }
details[open] summary::before { transform: rotate(90deg); }
details > :not(summary) { padding: 0 16px 14px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: 280px; border-right: 0; border-bottom: 1px solid var(--slate-200); }
}
