/* ═══════════════════════════════════════════════════════════
   docs.planitone.co — design system
   Sin dependencias externas. Light/dark automático + toggle.
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #f7f9fc;
  --bg-card: #ffffff;
  --bg-sunken: #eef2f8;
  --bg-code: #0f1729;
  --fg: #16213a;
  --fg-soft: #51607a;
  --fg-faint: #8b97ad;
  --line: #dfe6f0;
  --brand: #0b5cd6;
  --brand-soft: #e3edfc;
  --brand-fg: #0b5cd6;
  --ok: #0f8a4c;
  --ok-soft: #e0f5ea;
  --warn: #b97a08;
  --warn-soft: #fdf3dd;
  --bad: #c2382f;
  --bad-soft: #fde7e5;
  --violet: #6d4fc4;
  --violet-soft: #efe9fb;
  --radius: 12px;
  --sidebar-w: 264px;
  --shadow: 0 1px 2px rgba(22,33,58,.05), 0 4px 16px rgba(22,33,58,.06);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1322;
  --bg-card: #151d31;
  --bg-sunken: #0a0f1c;
  --bg-code: #0a0f1c;
  --fg: #e6ecf7;
  --fg-soft: #9fadc7;
  --fg-faint: #64718c;
  --line: #26314c;
  --brand: #5b96f2;
  --brand-soft: #16264a;
  --brand-fg: #7cabf5;
  --ok: #3fce85;
  --ok-soft: #0d2b1d;
  --warn: #e5b453;
  --warn-soft: #2d2410;
  --bad: #f07f77;
  --bad-soft: #331311;
  --violet: #a68bf0;
  --violet-soft: #201638;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1322; --bg-card: #151d31; --bg-sunken: #0a0f1c; --bg-code: #0a0f1c;
    --fg: #e6ecf7; --fg-soft: #9fadc7; --fg-faint: #64718c; --line: #26314c;
    --brand: #5b96f2; --brand-soft: #16264a; --brand-fg: #7cabf5;
    --ok: #3fce85; --ok-soft: #0d2b1d; --warn: #e5b453; --warn-soft: #2d2410;
    --bad: #f07f77; --bad-soft: #331311; --violet: #a68bf0; --violet-soft: #201638;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-fg); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .86em;
}
code { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 5px; padding: .1em .4em; }
pre {
  background: var(--bg-code); color: #dbe6ff; border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; line-height: 1.55; border: 1px solid var(--line);
}
pre code { background: none; border: none; padding: 0; color: inherit; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; margin: 2.2em 0 .5em; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 1.8em 0 .4em; }
p { margin: .55em 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ── Header ── */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; height: 56px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.02rem; color: var(--fg); }
.top .logo:hover { text-decoration: none; }
.top .logo .dot { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--brand), var(--violet)); }
.top .crumb { color: var(--fg-faint); font-size: .92rem; }
.top .spacer { flex: 1; }
.top nav { display: flex; gap: 4px; }
.top nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--fg-soft); font-size: .92rem; font-weight: 500;
}
.top nav a:hover { background: var(--bg-sunken); text-decoration: none; }
.top nav a.on { color: var(--brand-fg); background: var(--brand-soft); }
.theme-btn {
  border: 1px solid var(--line); background: var(--bg-card); color: var(--fg-soft);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
  display: grid; place-items: center;
}
.theme-btn:hover { background: var(--bg-sunken); }

/* ── Layout con sidebar ── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); max-width: 1360px; margin: 0 auto; }
.side {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 22px 14px 40px; border-right: 1px solid var(--line);
}
.side .grp { margin-bottom: 18px; }
.side .grp-t {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--fg-faint); padding: 0 10px 6px;
}
.side a.item {
  display: block; padding: 6px 10px; border-radius: 8px; color: var(--fg-soft);
  font-size: .93rem; margin-bottom: 1px;
}
.side a.item:hover { background: var(--bg-sunken); text-decoration: none; }
.side a.item.on { background: var(--brand-soft); color: var(--brand-fg); font-weight: 600; }
main.doc { padding: 34px 44px 90px; max-width: 900px; }
main.doc.wide { max-width: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main.doc { padding: 24px 18px 70px; }
}

/* ── Componentes ── */
.lead { font-size: 1.08rem; color: var(--fg-soft); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.chip.ok    { background: var(--ok-soft);    color: var(--ok); }
.chip.warn  { background: var(--warn-soft);  color: var(--warn); }
.chip.bad   { background: var(--bad-soft);   color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand-fg); }
.chip.violet{ background: var(--violet-soft);color: var(--violet); }
.chip.dim   { background: var(--bg-sunken);  color: var(--fg-faint); }

.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

.stat { text-align: left; }
.stat .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--fg-faint); font-size: .84rem; margin-top: 2px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--fg-faint); padding: 8px 10px; border-bottom: 2px solid var(--line);
}
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:hover td { background: var(--bg-sunken); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); }
.tbl-wrap table.tbl td, .tbl-wrap table.tbl th { padding: 9px 14px; }

.callout {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 14px 0;
  font-size: .94rem;
}
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.bad  { border-color: var(--bad);  background: var(--bad-soft); }
.callout.ok   { border-color: var(--ok);   background: var(--ok-soft); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  padding: 9px 18px; border-radius: 9px; font-size: .94rem; font-weight: 600;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand-fg); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-sunken); }
.btn.sm { padding: 5px 12px; font-size: .85rem; }

input.inp, select.inp, textarea.inp {
  width: 100%; background: var(--bg-card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: .94rem;
  font-family: inherit;
}
input.inp:focus, select.inp:focus, textarea.inp:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand);
}
textarea.inp.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; }
label.lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--fg-soft); margin: 0 0 5px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 0; overflow-x: auto; }
.tabs button {
  background: none; border: none; cursor: pointer; color: var(--fg-soft);
  padding: 9px 15px; font-size: .92rem; font-weight: 600; border-bottom: 2px solid transparent;
  white-space: nowrap; font-family: inherit;
}
.tabs button.on { color: var(--brand-fg); border-bottom-color: var(--brand); }
.tabpanel { padding: 18px 0; }

/* Resultado del validador */
.verdict { display:flex; align-items:center; gap:10px; padding:12px 16px; border-radius:10px; font-weight:600; margin-top:12px; }
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.verdict.fail { background: var(--bad-soft); color: var(--bad); }
.verdict.na   { background: var(--bg-sunken); color: var(--fg-faint); }

/* Landing hero */
.hero { text-align: left; padding: 72px 24px 46px; max-width: 980px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.hero .grad {
  background: linear-gradient(100deg, var(--brand), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 1.12rem; color: var(--fg-soft); max-width: 620px; }
.cards-landing { max-width: 980px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pcard {
  display: block; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow); color: var(--fg); transition: transform .12s, border-color .12s;
}
.pcard:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.pcard .ic { font-size: 1.7rem; margin-bottom: 10px; }
.pcard h3 { margin: 0 0 6px; }
.pcard p { color: var(--fg-soft); font-size: .93rem; margin: 0 0 10px; }
.pcard.soon { opacity: .55; pointer-events: none; }

footer.ft { border-top: 1px solid var(--line); color: var(--fg-faint); font-size: .85rem; padding: 26px 24px; text-align: center; }

/* Detalles / acordeones */
details.acc { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); margin: 8px 0; }
details.acc > summary { cursor: pointer; padding: 11px 16px; font-weight: 600; list-style: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: "▸ "; color: var(--fg-faint); }
details.acc[open] > summary::before { content: "▾ "; }
details.acc .acc-body { padding: 2px 16px 14px; }

.searchbox { position: relative; margin-bottom: 12px; }
.searchbox input { padding-left: 34px; }
.searchbox::before { content: "🔎"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .85rem; opacity: .6; }

.kbd { border:1px solid var(--line); border-bottom-width:2px; border-radius:5px; background:var(--bg-sunken); padding:0 6px; font-size:.82em; font-family:ui-monospace,monospace; }
.muted { color: var(--fg-faint); }
.small { font-size: .86rem; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt0{margin-top:0}.mb0{margin-bottom:0}
