/* Manuales Fitra — hoja de estilos compartida.
   Inspirada en los tokens semánticos del producto
   (admin-office-shadcdn/src/index.css). Trasladados a variables CSS
   planas. Sin Tailwind, sin dependencias externas. */

:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(240 10% 3.9%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 46.1%);
  --border: hsl(240 5.9% 90%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(240 10% 3.9%);
  --primary: hsl(240 5.9% 10%);
  --primary-foreground: hsl(0 0% 98%);
  --accent: hsl(240 4.8% 95.9%);
  --accent-foreground: hsl(240 5.9% 10%);
  --destructive: hsl(0 84.2% 60.2%);
  --emerald: hsl(160 60% 38%);
  --sky: hsl(199 80% 45%);
  --amber: hsl(38 92% 50%);
  --violet: hsl(265 65% 55%);

  --radius: 0.5rem;
  --max-read: 72ch;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(240 10% 3.9%);
    --foreground: hsl(0 0% 98%);
    --muted: hsl(240 3.7% 15.9%);
    --muted-foreground: hsl(240 5% 64.9%);
    --border: hsl(240 3.7% 15.9%);
    --card: hsl(240 6% 8%);
    --card-foreground: hsl(0 0% 98%);
    --primary: hsl(0 0% 98%);
    --primary-foreground: hsl(240 5.9% 10%);
    --accent: hsl(240 3.7% 15.9%);
    --accent-foreground: hsl(0 0% 98%);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

main { flex: 1; }

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { opacity: 0.8; }

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 2.25rem 0 1rem;
  font-weight: 700;
}
h1 { font-size: 2rem; margin-top: 0.5rem; }
h2 { font-size: 1.5rem; border-top: 1px solid var(--border); padding-top: 2rem; }
h3 { font-size: 1.15rem; color: var(--foreground); }
h4 { font-size: 1rem; color: var(--muted-foreground); margin-top: 1.5rem; }

p { margin: 0.75rem 0; max-width: var(--max-read); }

ul, ol { padding-left: 1.5rem; max-width: var(--max-read); }
li { margin: 0.35rem 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  max-width: var(--max-read);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}

.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.toc h2 {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.card.tone-sky { border-left: 4px solid var(--sky); }
.card.tone-emerald { border-left: 4px solid var(--emerald); }
.card.tone-amber { border-left: 4px solid var(--amber); }
.card.tone-violet { border-left: 4px solid var(--violet); }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
}
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
.cards .card { margin: 0; padding: 0; }
.cards .card > a {
  display: block;
  padding: 1.25rem 1.5rem;
  color: var(--foreground);
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.cards .card .card-title {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
}
.cards .card .desc {
  display: block;
  color: var(--muted-foreground);
  font-size: 0.92rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  vertical-align: middle;
}
.badge.req { background: hsl(0 84% 92%); color: hsl(0 70% 35%); }
.badge.opt { background: hsl(38 92% 90%); color: hsl(28 70% 35%); }
.badge.tpl { background: hsl(265 65% 92%); color: hsl(265 50% 35%); }

@media (prefers-color-scheme: dark) {
  .badge.req { background: hsl(0 50% 22%); color: hsl(0 80% 80%); }
  .badge.opt { background: hsl(28 50% 22%); color: hsl(38 80% 75%); }
  .badge.tpl { background: hsl(265 50% 25%); color: hsl(265 80% 80%); }
}

dl { margin: 1rem 0; max-width: var(--max-read); }
dl dt { font-weight: 600; margin-top: 0.75rem; }
dl dd {
  margin: 0.15rem 0 0.5rem 0;
  color: var(--muted-foreground);
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  background: var(--card);
}
details[open] { background: var(--card); }
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--muted-foreground);
  transition: transform 120ms ease;
}
details[open] summary::before { transform: rotate(90deg); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--amber);
  background: var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--foreground);
  font-style: italic;
}
blockquote.tip { border-left-color: var(--emerald); }
blockquote.warn { border-left-color: var(--destructive); }

nav.crumbs {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}
nav.crumbs a { color: var(--muted-foreground); }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  background: var(--card);
}
.step header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.step header .num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.step header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.step header .desc {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.field-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1rem;
}
@media (min-width: 640px) {
  .field-list { grid-template-columns: 1fr 1fr; }
}
.field-list .field {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  background: var(--background);
}
.field-list .field strong { display: block; font-size: 0.95rem; }
.field-list .field small { color: var(--muted-foreground); font-size: 0.82rem; }

.glossary dt { color: var(--foreground); }
.glossary dd { margin-bottom: 0.85rem; }

.callout-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .callout-grid { grid-template-columns: 1fr 1fr; }
}

/* === Screenshot + hotspot annotations === */
figure.screenshot {
  margin: 1.25rem 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
figure.screenshot .shot {
  position: relative;
  display: block;
  width: 100%;
  background: var(--muted);
}
figure.screenshot .shot img {
  display: block;
  width: 100%;
  height: auto;
}
figure.screenshot .hotspot {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: hsl(0 84% 55%);
  color: white;
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(220,30,30,0.45), 0 0 0 3px rgba(255,255,255,0.95);
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
figure.screenshot figcaption {
  padding: 0.85rem 1.1rem 1rem;
  background: var(--card);
}
figure.screenshot figcaption ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: cnum;
}
figure.screenshot figcaption ol li {
  position: relative;
  padding: 0.45rem 0 0.45rem 2.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
figure.screenshot figcaption ol li:first-child { border-top: none; }
figure.screenshot figcaption ol li::before {
  counter-increment: cnum;
  content: counter(cnum);
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: hsl(0 84% 55%);
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.whats-new {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: hsl(160 60% 92%);
  color: hsl(160 60% 22%);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  .whats-new { background: hsl(160 60% 22%); color: hsl(160 60% 90%); }
}

@media print {
  :root {
    --background: #fff;
    --foreground: #000;
    --muted: #f4f4f4;
    --muted-foreground: #444;
    --border: #ccc;
    --card: #fff;
    --primary: #000;
    --primary-foreground: #fff;
  }
  body { font-size: 11pt; line-height: 1.45; }
  .shell { max-width: none; padding: 0; }
  nav.crumbs, footer, .toc { display: none; }
  details { border: none; padding: 0; }
  details summary { display: none; }
  details > *:not(summary) { display: block !important; }
  h1, h2, h3 { page-break-after: avoid; }
  .step, .card { page-break-inside: avoid; }
}
