/* deagrapa — estilos del sitio, panel y administrador. Naranja y blanco. */
:root {
  --orange: #FF6A13;
  --orange-600: #E85A05;
  --orange-700: #C24A02;
  --orange-100: #FFE7D6;
  --orange-50: #FFF6EF;
  --ink: #241B16;
  --ink-2: #4A3F38;
  --muted: #7A6E66;
  --line: #F0E5DC;
  --bg: #FFFFFF;
  --ok: #138A4B;
  --ok-bg: #E6F6EC;
  --warn: #9A5B00;
  --warn-bg: #FFF3D6;
  --bad: #C0322B;
  --bad-bg: #FDE8E6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(36, 27, 22, .04), 0 8px 24px rgba(36, 27, 22, .06);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--orange-600); text-decoration: none; }
a:hover { color: var(--orange-700); text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { background: var(--orange-50); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.inline { display: inline; }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.pad-lg { padding-top: 40px; padding-bottom: 56px; }
.pad-xl { padding-top: 80px; padding-bottom: 80px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: #fff; border: 1.5px solid var(--orange);
  font: 600 .98rem/1 var(--font); padding: 12px 20px; border-radius: 999px;
  cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--orange-600); border-color: var(--orange-600); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--orange-600); border-color: var(--orange-100); }
.btn-ghost:hover { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-100); }
.btn-white { background: #fff; color: var(--orange-600); border-color: #fff; }
.btn-white:hover { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-50); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #9e2822; border-color: #9e2822; }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--orange-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: .95rem; }
.icon-btn:hover:not(:disabled) { border-color: var(--orange-100); background: var(--orange-50); color: var(--orange-600); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--orange); color: #fff; font-weight: 800; font-size: 1.15rem; }
.logo-sm { font-size: 1.05rem; }
.logo-sm .logo-mark { width: 26px; height: 26px; border-radius: 8px; font-size: .95rem; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn), .nav .link-btn { color: var(--ink-2); font-weight: 500; }
.nav a:not(.btn):hover, .nav .link-btn:hover { color: var(--orange-600); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 9px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 5px 0; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav > a, .nav > form { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav > .btn { margin-top: 12px; border-bottom: 0; }
}

/* ---------- Mensajes ---------- */
.flashes { padding-top: 16px; }
.flash { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; font-size: .95rem; border: 1px solid transparent; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-ok { background: var(--ok-bg); color: #0c5a31; border-color: #c9ebd6; }
.flash-error { background: var(--bad-bg); color: #8a211b; border-color: #f7cdc9; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #f6e0a8; }
.flash-info { background: var(--orange-50); color: var(--ink-2); border-color: var(--orange-100); }
.note { background: var(--orange-50); border: 1px solid var(--orange-100); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .93rem; margin-bottom: 14px; }
.note-ok { background: var(--ok-bg); border-color: #c9ebd6; }

/* ---------- Portada ---------- */
.hero { background: linear-gradient(180deg, var(--orange-50) 0%, #fff 100%); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.eyebrow { display: inline-block; background: #fff; border: 1px solid var(--orange-100); color: var(--orange-700); font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: 1.04; letter-spacing: -.03em; }
.hl { color: var(--orange); }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.hero-phone { position: relative; display: flex; justify-content: center; }
.hero-blob { position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 106, 19, .28), rgba(255, 106, 19, 0) 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 0; }
.phone { position: relative; z-index: 1; width: 280px; border-radius: 36px; background: #fff; border: 10px solid var(--ink); box-shadow: 0 30px 60px rgba(36, 27, 22, .18); overflow: hidden; transform: rotate(2.5deg); }
.phone-url { background: #F6F1ED; font-size: .78rem; color: var(--ink-2); text-align: center; padding: 10px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 6px; }
.lock { width: 8px; height: 9px; border: 1.5px solid var(--ink-2); border-radius: 2px; display: inline-block; position: relative; top: 1px; }
.phone-body { background: linear-gradient(180deg, #FF7A2A 0%, #FF5A00 100%); padding: 26px 18px 18px; color: #fff; text-align: center; min-height: 440px; }
.ph-avatar { width: 76px; height: 76px; border-radius: 50%; background: #fff; color: var(--orange); display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; margin: 0 auto 10px; border: 3px solid rgba(255, 255, 255, .6); }
.ph-name { font-weight: 800; font-size: 1.15rem; }
.ph-bio { font-size: .85rem; opacity: .9; margin-bottom: 16px; }
.ph-link { background: #fff; color: var(--ink); border-radius: 14px; padding: 12px; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.ph-badge { font-size: .72rem; opacity: .85; margin-top: 18px; }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .phone { width: 250px; }
}

.section { padding: 72px 0; }
.section-soft { background: var(--orange-50); }
.section-orange { background: var(--orange); color: #fff; }
.section-title { text-align: center; font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; margin-bottom: .6em; }
.section-sub { text-align: center; color: var(--ink-2); max-width: 620px; margin: 0 auto 32px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--orange-100); color: var(--orange-700); font-weight: 800; margin-bottom: 14px; }
.step p { color: var(--ink-2); margin: 0; }
.paths { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; max-width: 880px; margin: 0 auto 18px; }
.path { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); height: 100%; }
.path p { color: var(--ink-2); margin: 0; }
.path-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--orange-50); color: var(--orange); display: grid; place-items: center; margin-bottom: 14px; }
.path-or { font-weight: 800; color: var(--orange); font-size: 1.1rem; }
.audiences { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.aud { border-left: 4px solid var(--orange); padding: 6px 0 6px 18px; }
.aud p { color: var(--ink-2); margin: 0; }
.pro-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.pro-band h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); font-weight: 800; }
.pro-band p { margin: 0; max-width: 640px; opacity: .95; }
.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; color: var(--orange); font-weight: 800; }
.faq[open] summary::after { content: '–'; }
.faq p { color: var(--ink-2); margin: 10px 0 0; }
@media (max-width: 760px) {
  .steps, .audiences { grid-template-columns: 1fr; }
  .paths { grid-template-columns: 1fr; }
  .path-or { text-align: center; }
  .pro-band { flex-direction: column; align-items: flex-start; }
  .section { padding: 52px 0; }
}

/* ---------- Pie ---------- */
.footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 40px; }
.is-home .footer { margin-top: 0; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-in p { margin: 8px 0 0; }
.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a { color: var(--ink-2); }

/* ---------- Formularios ---------- */
.form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; color: var(--ink-2); }
.form label small, .help { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea,
.filters input, .filters select, .copy-row input, .row-inline input, .domain-input input, .domain-input select {
  display: block; width: 100%; margin-top: 6px; font: 400 1rem var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus, .domain-input input:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 19, .15);
}
.form input:disabled, .form select:disabled { background: #FAF7F5; color: var(--muted); }
.form textarea { resize: vertical; }
.form .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.form .check input { margin-top: 4px; accent-color: var(--orange); width: 17px; height: 17px; flex: none; }
.form .check.disabled { color: var(--muted); }
.form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.form legend { font-weight: 600; font-size: .92rem; color: var(--ink-2); margin-bottom: 8px; }
.input-prefix { display: flex; align-items: stretch; margin-top: 6px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.input-prefix span { background: var(--orange-50); color: var(--ink-2); padding: 11px 10px; font-weight: 500; font-size: .92rem; white-space: nowrap; border-right: 1.5px solid var(--line); }
.form .input-prefix input { border: 0 !important; margin: 0 !important; border-radius: 0; box-shadow: none !important; min-width: 0; }
.input-prefix:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 19, .15); }
.code-input { letter-spacing: .4em; font-size: 1.4rem !important; text-align: center; font-weight: 700 !important; }
.cf-turnstile { margin: 6px 0 16px; }

.auth { min-height: calc(100vh - 64px - 140px); display: grid; place-items: center; padding: 40px 16px; background: linear-gradient(180deg, var(--orange-50), #fff 60%); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.7rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row-inline { display: flex; gap: 10px; align-items: center; }
.row-inline input { margin-top: 0; }
@media (max-width: 480px) { .auth-card { padding: 24px 20px; } }

/* ---------- Tarjetas y grids ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-soft { background: var(--orange-50); border-color: var(--orange-100); }
.card-warn { background: var(--warn-bg); border-color: #f6e0a8; }
.card-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--orange-50); border-color: var(--orange-100); }
.card-cta p { margin: 0; }
.card-pro { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(120deg, var(--orange) 0%, #FF8B45 100%); color: #fff; border: 0; }
.card-pro p { margin: 0; opacity: .95; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2.tight { gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .card-cta, .card-pro { flex-direction: column; align-items: flex-start; } }

/* ---------- Panel del usuario ---------- */
.panel { padding-top: 32px; padding-bottom: 40px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h1 { margin-bottom: .15em; }
.panel-head p { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--orange-600); text-decoration: none; }
.tabs a.active { color: var(--orange-600); border-bottom-color: var(--orange); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-n { display: block; font-size: 1.9rem; font-weight: 800; color: var(--orange); line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }
.domain-name { font-weight: 700; font-size: 1.1rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.domain-name.big { font-size: 1.5rem; font-weight: 800; }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 260px; margin-top: 0; background: var(--orange-50); }
.progress-item { margin-bottom: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.bar { height: 10px; background: var(--orange-50); border-radius: 999px; overflow: hidden; border: 1px solid var(--orange-100); }
.bar span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .4s; }
.progress-or { text-align: center; font-size: .8rem; color: var(--muted); font-weight: 700; margin: 8px 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.checklist li.ok { color: var(--ok); }
.checklist li.no { color: var(--ink-2); }
.domain-input { display: flex; gap: 8px; margin-bottom: 14px; }
.domain-input input { flex: 1; margin-top: 0; font-size: 1.1rem; font-weight: 600; }
.domain-input select { width: 110px; margin-top: 0; font-weight: 600; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0 0 16px; font-size: .94rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; }

/* Editor de página */
.editor { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.editor-preview { position: sticky; top: 84px; }
.preview-phone { border: 10px solid var(--ink); border-radius: 34px; overflow: hidden; height: 620px; background: #fff; box-shadow: var(--shadow); }
.preview-phone iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 980px) { .editor { grid-template-columns: 1fr; } .editor-preview { position: static; max-width: 340px; margin: 0 auto; } }
.avatar-row { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar-row label { margin-bottom: 4px; }
.avatar-prev { width: 84px; height: 84px; border-radius: 50%; background: var(--orange-100); color: var(--orange-700); display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; overflow: hidden; flex: none; }
.avatar-prev img { width: 100%; height: 100%; object-fit: cover; }
.file-label input { margin-top: 6px; font-size: .9rem; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { display: flex !important; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; margin: 0 !important; cursor: pointer; font-weight: 500 !important; }
.theme-opt input { accent-color: var(--orange); }
.theme-opt:has(input:checked) { border-color: var(--orange); background: var(--orange-50); }
.theme-opt.locked { opacity: .55; cursor: not-allowed; }
.theme-opt em { font-style: normal; font-size: .72rem; background: var(--ink); color: #fff; padding: 1px 6px; border-radius: 999px; margin-left: 2px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .08); }
.swatch-naranja { background: linear-gradient(135deg, #FF7A2A, #FF5A00); }
.swatch-blanco { background: #fff; box-shadow: inset 0 0 0 4px var(--orange); }
.swatch-noche { background: #1C1512; box-shadow: inset 0 0 0 4px #FF6A13; }
.swatch-atardecer { background: linear-gradient(135deg, #FF5F6D, #FFC371); }
.swatch-menta { background: linear-gradient(135deg, #E9FFF5, #2EC4A0); }
.swatch-papel { background: #F5EFE6; box-shadow: inset 0 0 0 4px #2A211C; }
@media (max-width: 520px) { .themes { grid-template-columns: repeat(2, 1fr); } }
.link-list { list-style: none; padding: 0; margin: 0 0 16px; }
.link-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.link-item.off { background: #FAF7F5; }
.link-item.off .link-txt strong { color: var(--muted); text-decoration: line-through; }
.link-summary { display: flex; align-items: center; gap: 12px; }
.link-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--orange-50); color: var(--orange); display: grid; place-items: center; flex: none; }
.link-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-txt .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-actions { display: flex; gap: 4px; }
.link-actions form { margin: 0; }
.link-edit { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.link-edit input, .link-edit select, .add-link input, .add-link select { margin-top: 0 !important; }
.add-link { border-top: 1px solid var(--line); padding-top: 16px; }
.add-link .grid-3 { margin-bottom: 12px; }
@media (max-width: 560px) { .link-summary { flex-wrap: wrap; } .link-actions { width: 100%; justify-content: flex-end; } }

/* ---------- Insignias ---------- */
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-muted { background: #F3EEEA; color: var(--muted); }
.badge-pro { background: var(--ink); color: #fff; }

/* ---------- Directorio ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.filters input { flex: 1 1 240px; margin-top: 0; }
.filters select { flex: 0 1 220px; margin-top: 0; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.dir-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 16px 18px; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.dir-card:hover { text-decoration: none; border-color: var(--orange-100); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.dir-card.featured { border-color: var(--orange); background: linear-gradient(180deg, var(--orange-50), #fff); }
.dir-tag { position: absolute; top: 10px; right: 10px; background: var(--orange); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.dir-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--orange-100); color: var(--orange-700); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; overflow: hidden; margin-bottom: 8px; }
.dir-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dir-url { color: var(--orange-600); margin-top: 4px; word-break: break-all; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 28px 0 0; font-size: .95rem; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FFFBF8; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 9px 4px; }
.table .row-off td { opacity: .55; }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline-block; margin: 0 4px 4px 0; }
.table .detail { max-width: 360px; word-break: break-word; }
.card .table:not(.compact) { margin: 0; }

/* ---------- Administrador ---------- */
body.admin { background: #FFFBF8; }
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.admin-side .logo { padding: 0 8px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.admin-side nav a:hover { background: var(--orange-50); color: var(--orange-700); text-decoration: none; }
.admin-side nav a.active { background: var(--orange); color: #fff; }
.admin-side nav .count { background: var(--orange-100); color: var(--orange-700); font-size: .75rem; padding: 1px 8px; border-radius: 999px; }
.admin-side nav a.active .count { background: rgba(255, 255, 255, .25); color: #fff; }
.admin-side-foot { margin-top: auto; display: flex; justify-content: space-between; padding: 0 8px; font-size: .9rem; }
.admin-main { padding: 22px 28px 48px; min-width: 0; }
.admin-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-top h1 { margin: 0; font-size: 1.6rem; flex: 1; }
.admin-top .nav-toggle { margin-left: -8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-n { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.kpi-l { color: var(--muted); font-size: .85rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips a { background: #fff; border: 1px solid var(--line); color: var(--ink-2); padding: 7px 13px; border-radius: 999px; font-size: .88rem; font-weight: 600; }
.chips a span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chips a:hover { border-color: var(--orange-100); text-decoration: none; color: var(--orange-700); }
.chips a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips a.active span { color: rgba(255, 255, 255, .7); }
.activate-box { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.steps-list { padding-left: 18px; margin: 0 0 10px; }
.steps-list li { margin-bottom: 8px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255, 251, 248, 0), #FFFBF8 40%); padding: 18px 0; }
.settings .card { margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; position: fixed; inset: 0 30% 0 0; z-index: 50; height: 100vh; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  .admin-side.open { display: flex; }
  .admin-top .nav-toggle { display: block; }
  .admin-main { padding: 16px; }
}

/* ---------- Errores y legales ---------- */
.error-code { font-size: 5rem; font-weight: 800; color: var(--orange); line-height: 1; margin-bottom: 10px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ---------- v2: perfil, insignias, opciones ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { margin-bottom: .1em; }
.profile-head p { margin: 0 0 6px; }
.profile-avatar { width: 68px; height: 68px; border-radius: 50%; overflow: hidden; flex: none; background: var(--orange-100); color: var(--orange-700); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--orange-100); }
.profile-avatar:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--orange); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ach { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 0; }
.ach li { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--orange-50); color: var(--orange-700); border: 1px solid var(--orange-100); }
.ach li.ach-pro { background: var(--ink); color: #fff; border-color: var(--ink); }
.ach li.ach-verificado { background: var(--ok-bg); color: var(--ok); border-color: #c9ebd6; }
.ach-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ach-list li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; opacity: .6; }
.ach-list li.has { opacity: 1; border-color: var(--orange-100); background: var(--orange-50); }
.ach-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--orange); border: 1px solid var(--orange-100); }
.ach-ico svg { width: 18px; height: 18px; }
@media (max-width: 700px) { .ach-list { grid-template-columns: 1fr; } }
.avatar-prev.big { width: 110px; height: 110px; font-size: 2rem; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex !important; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 !important; cursor: pointer; font-weight: 500 !important; }
.choice input { margin-top: 4px; accent-color: var(--orange); }
.choice:has(input:checked) { border-color: var(--orange); background: var(--orange-50); }
.choice-body { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
@media (max-width: 600px) { .choice-cards { grid-template-columns: 1fr; } }
.input-suffix span { border-right: 0; border-left: 1.5px solid var(--line); order: 2; }
.is-dimmed { opacity: .65; }
.mini-form { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.mini-form input { margin: 0 !important; flex: 1 1 200px; padding: 8px 10px !important; font-size: .88rem !important; }
.inline-select select { font: inherit; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; }
.panel-head .profile-head + * { margin-left: auto; }
