/* Tamboapp — Manual de usuario */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --line: #e7e1d8;
  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #8a837c;
  --brand: #ea580c;
  --brand-soft: #fff1e6;
  --brand-ink: #9a3412;
  --ok: #15803d;
  --ok-soft: #e8f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e1;
  --info: #1d4ed8;
  --info-soft: #e9effd;
  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 8px 24px -12px rgba(28, 25, 23, .12);
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Cascadia Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f;
    --surface: #1c1917;
    --surface-2: #26211e;
    --line: #342e2a;
    --text: #f5f1ec;
    --text-2: #c4bcb4;
    --text-3: #8f867e;
    --brand: #fb923c;
    --brand-soft: #3a2316;
    --brand-ink: #fdba74;
    --ok: #4ade80;
    --ok-soft: #15291c;
    --warn: #fbbf24;
    --warn-soft: #33270f;
    --info: #93b4fd;
    --info-soft: #1a2440;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14110f;
  --surface: #1c1917;
  --surface-2: #26211e;
  --line: #342e2a;
  --text: #f5f1ec;
  --text-2: #c4bcb4;
  --text-3: #8f867e;
  --brand: #fb923c;
  --brand-soft: #3a2316;
  --brand-ink: #fdba74;
  --ok: #4ade80;
  --ok-soft: #15291c;
  --warn: #fbbf24;
  --warn-soft: #33270f;
  --info: #93b4fd;
  --info-soft: #1a2440;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* Color por perfil */
.role-superadmin { --accent: #7c3aed; --accent-soft: #f1ebfe; }
.role-admin      { --accent: #ea580c; --accent-soft: #fff1e6; }
.role-gerente    { --accent: #0e7490; --accent-soft: #e4f5f8; }
.role-mozo       { --accent: #15803d; --accent-soft: #e8f6ec; }
.role-cocina     { --accent: #b91c1c; --accent-soft: #fdecec; }
.role-cajero     { --accent: #a16207; --accent-soft: #fbf3dc; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role-superadmin { --accent: #a78bfa; --accent-soft: #2a1f45; }
  :root:not([data-theme="light"]) .role-admin      { --accent: #fb923c; --accent-soft: #3a2316; }
  :root:not([data-theme="light"]) .role-gerente    { --accent: #22d3ee; --accent-soft: #0f2c33; }
  :root:not([data-theme="light"]) .role-mozo       { --accent: #4ade80; --accent-soft: #15291c; }
  :root:not([data-theme="light"]) .role-cocina     { --accent: #f87171; --accent-soft: #3a1818; }
  :root:not([data-theme="light"]) .role-cajero     { --accent: #facc15; --accent-soft: #332a0c; }
}
:root[data-theme="dark"] .role-superadmin { --accent: #a78bfa; --accent-soft: #2a1f45; }
:root[data-theme="dark"] .role-admin      { --accent: #fb923c; --accent-soft: #3a2316; }
:root[data-theme="dark"] .role-gerente    { --accent: #22d3ee; --accent-soft: #0f2c33; }
:root[data-theme="dark"] .role-mozo       { --accent: #4ade80; --accent-soft: #15291c; }
:root[data-theme="dark"] .role-cocina     { --accent: #f87171; --accent-soft: #3a1818; }
:root[data-theme="dark"] .role-cajero     { --accent: #facc15; --accent-soft: #332a0c; }

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

img, svg { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
}
.brand img { width: 30px; height: 30px; }
.brand small {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-3);
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
.topbar-spacer { flex: 1; }
.topbar a.top-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.topbar a.top-link:hover { color: var(--text); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

/* ---------- Portada ---------- */
.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 18px 0 18px;
  max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead {
  font-size: 18px;
  color: var(--text-2);
  max-width: 60ch;
  margin: 0;
}

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px;
}
.section > h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -.015em;
  margin: 0 0 6px;
}
.section > p.sub { color: var(--text-2); margin: 0 0 24px; max-width: 70ch; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.role-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.role-card .role-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.role-card .role-icon svg { width: 22px; height: 22px; }
.role-card h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -.01em;
}
.role-card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.role-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.role-card .go {
  position: absolute;
  top: 22px;
  right: 20px;
  color: var(--text-3);
  transition: color .18s, transform .18s;
}
.role-card:hover .go { color: var(--accent); transform: translateX(3px); }

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

/* Matriz de permisos */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 600;
  background: var(--surface-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--text-3); opacity: .6; }
.matrix td:first-child { font-weight: 500; white-space: nowrap; }

/* ---------- Página de perfil ---------- */
.doc {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
}
.toc {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 32px 0 40px;
}
.toc-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 600;
  margin: 0 0 10px;
}
.toc ol { list-style: none; margin: 0 0 24px; padding: 0; }
.toc li a {
  display: block;
  padding: 6px 12px;
  border-left: 2px solid var(--line);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .other-roles a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
}
.toc .other-roles a:hover { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.content { padding: 40px 0 96px; min-width: 0; }

.page-head {
  padding-bottom: 28px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.page-head .role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.page-head .role-badge span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
}
.page-head .role-badge svg { width: 14px; height: 14px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 16px 0 12px;
}
.page-head p.lead { font-size: 18px; color: var(--text-2); margin: 0; max-width: 64ch; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.fact b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.fact span { font-size: 14.5px; }

.content section { padding-top: 36px; }
.content h2 {
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.content h2 .num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}
.content h3 { font-size: 18px; margin: 28px 0 8px; letter-spacing: -.005em; }
.content p, .content li { color: var(--text-2); }
.content p { margin: 0 0 14px; max-width: 72ch; }
.content strong { color: var(--text); font-weight: 600; }
.content ul { padding-left: 20px; max-width: 72ch; }
.content ul li { margin: 4px 0; }

/* Ruta de navegación dentro de la app */
.path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  margin: 0 0 16px;
}
.path i { font-style: normal; color: var(--text-3); }

/* Pasos numerados */
ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 12px 0 20px;
  max-width: 72ch;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 16px 46px;
  margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
ol.steps > li::after {
  content: "";
  position: absolute;
  left: 14.5px;
  top: 34px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
ol.steps > li:last-child::after { display: none; }
ol.steps > li:last-child { padding-bottom: 4px; }

/* Botones e interfaz citados en el texto */
.ui {
  display: inline-block;
  font-size: .88em;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}
kbd, code {
  font-family: var(--font-mono);
  font-size: .85em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
}

/* Avisos */
.note {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  margin: 16px 0 20px;
  max-width: 72ch;
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.note svg { width: 20px; height: 20px; color: var(--info); margin-top: 2px; }
.note p { margin: 0; color: var(--text); font-size: 15px; }
.note p + p { margin-top: 6px; }
.note.tip { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.note.tip svg { color: var(--ok); }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.note.warn svg { color: var(--warn); }

/* Flujo de estados */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 20px;
}
.flow .st {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.flow .st small { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.flow .st.end { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.flow .arrow { color: var(--text-3); }

/* Tarjetas de módulos */
.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 14px 0 8px;
}
.module {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}
a.module:hover { border-color: var(--accent); }
.module b { display: block; font-size: 14.5px; }
.module span { font-size: 13px; color: var(--text-3); }

/* Lista de verificación */
ul.check { list-style: none; padding: 0; }
ul.check li { position: relative; padding-left: 28px; margin: 8px 0; }
ul.check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
}
ul.check li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 5px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Preguntas frecuentes */
details.faq {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 0 16px;
  margin: 10px 0;
  max-width: 72ch;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding: 0 0 14px; }
details.faq > div p:last-child { margin-bottom: 0; }

/* Navegación anterior/siguiente */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}
.pager a:hover { border-color: var(--brand); }
.pager a small { display: block; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pager a.next { text-align: right; grid-column: 2; }

/* Pie */
.footer {
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13.5px;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* Primeros pasos en portada */
.basics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.basic {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.basic h3 { margin: 0 0 8px; font-size: 17px; }
.basic p, .basic li { color: var(--text-2); font-size: 14.5px; }
.basic p { margin: 0 0 8px; }
.basic ol { margin: 0; padding-left: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .doc { grid-template-columns: 1fr; gap: 0; }
  .menu-btn { display: inline-grid; }
  .toc {
    position: fixed;
    inset: 63px 0 0 0;
    height: calc(100vh - 63px);
    height: calc(100dvh - 63px);
    max-height: none;
    z-index: 15;
    background: var(--bg);
    padding: 24px;
    display: none;
  }
  body.toc-open .toc { display: block; }
  body.toc-open { overflow: hidden; }
}

@media (max-width: 640px) {
  .topbar-inner, .hero, .section, .doc, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .brand small, .topbar a.top-link { display: none; }
  .hero { padding-top: 44px; }
  .content { padding-top: 28px; }
  ol.steps > li { padding-left: 40px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: 1; }
}

@media print {
  .topbar, .toc, .pager, .footer { display: none; }
  .doc { display: block; }
  body { background: #fff; }
  details.faq { break-inside: avoid; }
  details.faq > div { display: block; }
}
