/* ==========================================================================
   XEVY — hoja de estilos
   Claro y limpio. Colores tomados del escudo: negro, amarillo y azul.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --soft: #f6f5f1;
  --soft-2: #eeece6;
  --ink: #0c0e13;
  --ink-2: #1b1f29;
  --text: #2a2f3a;
  --muted: #646b79;
  --line: #e5e3dc;
  --line-2: #d6d3ca;

  --yellow: #ffc20e;
  --yellow-soft: #fff4cf;
  --blue: #1463ff;
  --blue-ink: #0a3fc0;
  --blue-soft: #e8efff;

  --ok: #12805c;   --ok-soft: #e3f5ee;
  --warn: #a15c00; --warn-soft: #fff1da;
  --bad: #c0362c;  --bad-soft: #fde8e6;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(12, 14, 19, .06);
  --shadow: 0 1px 2px rgba(12, 14, 19, .05), 0 8px 24px -8px rgba(12, 14, 19, .12);
  --shadow-lg: 0 2px 4px rgba(12, 14, 19, .04), 0 24px 60px -20px rgba(12, 14, 19, .25);
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.ico { flex-shrink: 0; vertical-align: middle; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); }
.row-gap { display: flex; flex-wrap: wrap; gap: 12px; }
.mono { font-family: var(--mono); font-size: .9em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: var(--ink); border-color: #f0b400; }
.btn-primary:hover { background: #ffcd3a; color: var(--ink); box-shadow: 0 6px 18px -6px rgba(255, 178, 0, .7); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--soft); color: var(--ink); border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f1c4c0; }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-xs { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Selector de idioma y menú de usuario ---------- */
[data-dropdown] { position: relative; }
.flag { width: 20px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); object-fit: cover; }
.lang-btn, .usermenu-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.lang-btn:hover, .usermenu-btn:hover { border-color: var(--line-2); background: var(--soft); }
.usermenu-btn { padding: 4px 12px 4px 4px; font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--yellow); font-weight: 700; font-size: 13px; }
.dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dropdown-right { left: auto; right: 0; }
[data-dropdown].open .dropdown { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--soft); color: var(--ink); }
.dropdown a[aria-current] { font-weight: 700; background: var(--yellow-soft); }
.dropdown form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* ==========================================================================
   Web pública
   ========================================================================== */

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .04em; }
.brand img { width: auto; height: 40px; }
.brand:hover { color: var(--ink); }
.brand-light, .brand-light:hover { color: #fff; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; gap: 24px; height: 72px; }
.nav-menu { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 24px; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); background: var(--soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; color: var(--ink); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; background: #fff; padding: 16px 24px 24px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; max-height: calc(100vh - 72px); overflow: auto; }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; margin: 0; }
  .nav-links a { padding: 12px; font-size: 17px; }
  .nav-actions { flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
  .nav-actions .btn { flex: 1; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; background:
  radial-gradient(800px 400px at 85% 0%, var(--yellow-soft), transparent 70%),
  radial-gradient(700px 400px at 100% 80%, var(--blue-soft), transparent 70%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 75%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 75%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #20c07a; box-shadow: 0 0 0 4px rgba(32,192,122,.18); }
.display { font-size: clamp(40px, 6vw, 72px); font-weight: 800; letter-spacing: -.035em; margin: 22px 0 20px; }
.display em { font-style: normal; position: relative; white-space: nowrap; }
.display em::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .32em; background: var(--yellow); z-index: -1; border-radius: 3px; }
.display .blue { color: var(--blue); }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 26px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--text); }
.hero-points li { display: inline-flex; align-items: center; gap: 6px; }
.hero-points .ico { color: var(--ok); }

.hero-art { position: relative; min-width: 0; align-self: center; }
.panel { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.panel-code { margin: 10px 40px 0 0; background: var(--ink); border-color: var(--ink); color: #d9dce4; overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #262a35; font-family: var(--mono); font-size: 12px; color: #8a90a0; }
.panel-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4c; }
.panel-bar i:first-child { background: var(--yellow); }
.panel-bar span { margin-left: 8px; }
.panel-code pre { margin: 0; padding: 18px 20px 22px; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; overflow-x: auto; }
.c-k { color: #7fa8ff; } .c-f { color: var(--yellow); } .c-s { color: #7ee2b0; }
/* Pegada a la caja de código, sin taparla */
.panel-status { margin: 0 0 20px auto; width: 290px; padding: 18px 20px; font-size: 14px; color: var(--ink); }
.status-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status-row b { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.pill { width: 10px; height: 10px; border-radius: 50%; }
.pill-ok { background: #20c07a; } .pill-run { background: var(--blue); }
.status-title { margin: 0 0 10px; font-weight: 700; line-height: 1.35; }
.status-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.panel-status .status-row { font-weight: 500; line-height: 1.4; }
.panel-status .status-row + .status-row { margin-top: 6px; }
.panel-status .ico { color: var(--ok); flex: none; }
.hero-base { position: relative; }
.hero-badge { position: absolute; left: 10px; top: 21px; width: 104px; filter: drop-shadow(0 16px 30px rgba(12,14,19,.25)); transform: rotate(-6deg); }

.tech-strip { position: relative; display: flex; align-items: center; gap: 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.tech-label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tech-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); opacity: .75; }

@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .tech-strip { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 520px) {
  .panel-code { margin-right: 0; }
  .panel-code pre { font-size: 11.5px; }
  .panel-status { width: 240px; }
  .hero-badge { width: 76px; }
}

/* ---------- Secciones ---------- */
.section { padding: 104px 0; }
.section-soft { background: var(--soft); }
.section-ink { background: var(--ink); color: #c9ccd5; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(32px, 4.2vw, 50px); }
.section-head p:last-child { font-size: 18px; color: var(--muted); margin: 0; }
.section-ink .section-head p:last-child { color: #a3a8b5; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: 14px; font-weight: 500; }
.section-ink .eyebrow { color: var(--yellow); }
@media (max-width: 720px) { .section { padding: 72px 0; } .section-head { margin-bottom: 36px; } }

/* ---------- Servicios ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; transition: border-color .2s, box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.service:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-3px); }
.service-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.service-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); }
.service-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.service h3 { font-size: 23px; margin-bottom: 10px; }
.service > p { color: var(--muted); font-size: 15.5px; }
.service-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; font-size: 14.5px; }
.service-list li { position: relative; padding-left: 18px; }
.service-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--yellow); }
.service-tags { margin: auto 0 0; padding-top: 16px; border-top: 1px dashed var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.service-featured { background: var(--ink); border-color: var(--ink); color: #c9ccd5; }
.service-featured h3 { color: #fff; }
.service-featured > p, .service-featured .service-tags { color: #a3a8b5; }
.service-featured .service-tags { border-top-color: #2b303c; }
.service-featured .service-icon { background: var(--yellow); color: var(--ink); }
@media (max-width: 960px) { .services { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* ---------- Proceso ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid #262a35; }
.step { padding: 32px 28px 8px 0; position: relative; }
.step + .step { padding-left: 28px; border-left: 1px solid #262a35; }
.step-num { display: inline-block; font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--yellow); padding: 3px 9px; border-radius: 6px; margin-bottom: 18px; font-weight: 500; }
.step h3 { font-size: 24px; }
.step p { color: #a3a8b5; font-size: 15.5px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { border-left: 0; padding-left: 0; }
  .step:nth-child(n+3) { border-top: 1px solid #262a35; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-left: 0; padding-left: 0; border-top: 1px solid #262a35; }
}

/* ---------- Qué construimos ---------- */
.work-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.work { grid-column: span 2; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.work-wide { grid-column: span 3; }
.work:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.work-visual { height: 230px; display: grid; place-items: center; position: relative; overflow: hidden; }
.work-info { padding: 24px 26px 26px; }
.work-info h3 { font-size: 24px; margin-bottom: 8px; }
.work-info p { color: var(--muted); margin: 0; font-size: 15.5px; }
.work-cat { display: inline-block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: 8px; }

.wv-erp { background: var(--blue-soft); }
.mock { width: 82%; height: 170px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; overflow: hidden; transform: translateY(24px); }
.mock-side { width: 22%; background: var(--ink); padding: 14px 10px; display: grid; gap: 8px; align-content: start; }
.mock-side i { height: 8px; border-radius: 4px; background: #343a48; }
.mock-side i:first-child { background: var(--yellow); width: 70%; }
.mock-body { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-kpis b { height: 34px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); }
.mock-kpis b:first-child { background: var(--yellow-soft); border-color: #ffe18a; }
.mock-chart { flex: 1; display: flex; align-items: flex-end; gap: 8px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.mock-chart s { flex: 1; background: var(--blue); border-radius: 4px 4px 0 0; opacity: .85; }
.mock-chart s:nth-child(even) { background: #9bbcff; }

.wv-shop { background: var(--yellow-soft); }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 62%; }
.shop span { aspect-ratio: 1; background: #fff; border-radius: 12px; box-shadow: var(--shadow); position: relative; }
.shop span::after { content: ""; position: absolute; left: 12px; right: 30%; bottom: 12px; height: 8px; border-radius: 4px; background: var(--soft-2); }
.shop span:first-child { background: var(--ink); }
.shop span:first-child::after { background: var(--yellow); }

.wv-portal { background: var(--soft); }
.portal { width: 70%; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; }
.portal span { height: 12px; border-radius: 6px; background: var(--soft-2); }
.portal .pl { width: 45%; height: 16px; background: var(--ink); }
.portal .pb { width: 38%; height: 28px; border-radius: 99px; background: var(--yellow); margin-top: 6px; }

.wv-sync { background: var(--ink); }
.sync { display: flex; align-items: center; gap: 0; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.sync span { padding: 12px 18px; border-radius: 12px; background: #1d212c; color: #c9ccd5; border: 1px solid #2d3240; }
.sync .sync-core { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.sync em { width: 56px; height: 2px; background: repeating-linear-gradient(90deg, var(--blue) 0 8px, transparent 8px 14px); background-size: 28px 2px; animation: flow 1.2s linear infinite; }
@keyframes flow { to { background-position: 28px 0; } }

@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; } .work, .work-wide { grid-column: auto; } }

/* ---------- Nosotros ---------- */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; align-items: center; }
.about-media { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 48px; position: relative; }
.about-media::before { content: ""; position: absolute; inset: 18px; border: 1px dashed var(--line-2); border-radius: 18px; }
.about-media img { position: relative; width: 70%; filter: drop-shadow(0 20px 30px rgba(12,14,19,.2)); }
.about-copy h2 { font-size: clamp(30px, 3.6vw, 44px); }
.about-copy > p { color: var(--muted); font-size: 17px; }
.values { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.values li { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.values .ico { color: var(--blue-ink); margin-top: 2px; }
.values strong { display: block; color: var(--ink); }
.values span { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 40px; } .about-media { max-width: 360px; } }

/* ---------- Promo área de cliente ---------- */
.portal-promo { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; background: linear-gradient(135deg, var(--yellow-soft), #fff 60%); border: 1px solid #f3df9c; border-radius: 28px; padding: 56px; }
.portal-promo h2 { font-size: clamp(28px, 3.4vw, 42px); }
.portal-promo > div > p { color: var(--muted); font-size: 17px; margin-bottom: 26px; }
.portal-features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.portal-features li { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 6px; }
.portal-features .ico { color: var(--blue-ink); }
.portal-features strong { color: var(--ink); }
.portal-features span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 900px) { .portal-promo { grid-template-columns: 1fr; padding: 32px; gap: 32px; } }
@media (max-width: 520px) { .portal-features { grid-template-columns: 1fr; } .portal-promo { padding: 24px; border-radius: 20px; } }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; }
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 0 22px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; color: var(--ink); font-size: 16.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { font-family: var(--mono); font-size: 20px; line-height: 1; transition: transform .2s; color: var(--blue-ink); }
.faq details[open] summary span { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 20px; }
@media (max-width: 900px) { .faq-wrap { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.contact-copy h2 { font-size: clamp(32px, 4vw, 48px); }
.contact-copy > p { color: var(--muted); font-size: 17px; }
.contact-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.contact-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.contact-list .ico { color: var(--blue-ink); }
.contact-list a { color: var(--ink); text-decoration: none; }
.contact-list a:hover { color: var(--blue); }
.contact-note { border-left: 3px solid var(--yellow); padding: 4px 0 4px 18px; margin-top: 28px; }
.contact-note strong { color: var(--ink); }
.contact-note p { color: var(--muted); margin: 4px 0 8px; font-size: 15px; }
.contact-note a { font-weight: 600; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #a3a8b5; padding: 72px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin-top: 16px; max-width: 280px; }
.footer-title { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); margin-bottom: 16px; font-weight: 500; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-list a { color: #c9ccd5; text-decoration: none; font-size: 15px; }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid #262a35; font-size: 14px; }
.to-top { color: #c9ccd5; text-decoration: none; }
.to-top:hover { color: #fff; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Páginas legales ---------- */
.legal { padding: 64px 0 96px; }
.legal .wrap { max-width: 820px; }
.legal h1 { font-size: clamp(32px, 4vw, 46px); }
.legal h2 { font-size: 22px; margin-top: 36px; }
.legal p, .legal li { color: var(--text); }

/* ---------- Aparición al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   Formularios, tarjetas y componentes comunes
   ========================================================================== */

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.card-tight { padding: 0; overflow: hidden; }
.card h2 { font-size: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { margin: 0; }
.form { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=number], .field input[type=date], .field select, .field textarea, .input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(20,99,255,.15); }
.field small { color: var(--muted); font-size: 13px; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--bad); }
.field small.err { color: var(--bad); font-weight: 500; }
.field.check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); }
.field.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); flex-shrink: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.alert { padding: 13px 16px; border-radius: 10px; font-size: 15px; border: 1px solid; margin-bottom: 18px; }
.alert-success { background: var(--ok-soft); border-color: #b5e3d0; color: #0b5a40; }
.alert-error { background: var(--bad-soft); border-color: #f4c3bd; color: #8f241c; }
.alert-info { background: var(--blue-soft); border-color: #c5d6ff; color: #0a3594; }
.alert-warn { background: var(--warn-soft); border-color: #f5d7a3; color: #774400; }
.form > .alert { margin-bottom: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--soft-2); color: var(--ink); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-nueva, .badge-abierto, .badge-pendiente, .badge-borrador { background: var(--yellow-soft); color: #7a5600; }
.badge-revision, .badge-en_curso, .badge-respondido, .badge-emitido { background: var(--blue-soft); color: var(--blue-ink); }
.badge-presupuestada, .badge-esperando { background: #f1e8ff; color: #5b2bb5; }
.badge-aceptada, .badge-aceptado, .badge-completado, .badge-pagado, .badge-cerrado { background: var(--ok-soft); color: var(--ok); }
.badge-rechazada, .badge-anulado, .badge-alta { background: var(--bad-soft); color: var(--bad); }
.badge-pausado, .badge-baja { background: var(--soft-2); color: var(--muted); }
.badge-normal { background: var(--soft); color: var(--text); }
.badge-admin { background: var(--ink); color: var(--yellow); }
.badge-cliente { background: var(--soft-2); color: var(--ink); }

/* ==========================================================================
   Páginas de acceso (login / registro)
   ========================================================================== */

.auth-page { min-height: 100vh; background:
  radial-gradient(600px 360px at 10% 0%, var(--yellow-soft), transparent 70%),
  radial-gradient(700px 420px at 100% 100%, var(--blue-soft), transparent 70%), var(--soft); }
.auth-top { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.auth-main { display: grid; place-items: center; padding: 24px 16px 64px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-size: 32px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
/* Registro */
.reg-row { align-items: start; }
.reg-wa { padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.reg-wa small { margin-top: 4px; line-height: 1.45; }
.auth-alt { text-align: center; margin-top: 22px; color: var(--muted); font-size: 15px; }
.auth-alt a { font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { color: var(--ink); }

/* ==========================================================================
   Área de cliente y panel admin
   ========================================================================== */

.app { background: var(--soft); }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-admin .sidebar { background: var(--ink); border-right-color: var(--ink); }
.sidebar-head { padding: 20px 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .brand { font-size: 19px; }
.sidebar .brand img { height: 34px; }
.app-admin .sidebar .brand { color: #fff; }
.area-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--yellow-soft); color: #7a5600; }
.app-admin .area-tag { background: var(--yellow); color: var(--ink); }
.side-nav { display: grid; gap: 2px; padding: 8px 12px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.side-nav a:hover { background: var(--soft); color: var(--ink); }
.side-nav a.is-active { background: var(--ink); color: #fff; }
.side-nav a.is-active .ico { color: var(--yellow); }
.app-admin .side-nav a { color: #b6bac6; }
.app-admin .side-nav a:hover { background: #1b1f29; color: #fff; }
.app-admin .side-nav a.is-active { background: #232835; color: #fff; }
.side-nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: 12px; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 20px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.app-admin .sidebar-foot { border-top-color: #232835; }
.sidebar-foot a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.sidebar-foot a:hover { background: var(--soft); color: var(--ink); }
.app-admin .sidebar-foot a { color: #8a90a0; }
.app-admin .sidebar-foot a:hover { background: #1b1f29; color: #fff; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.side-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 7px; cursor: pointer; color: var(--ink); }
.content { padding: 32px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.scrim { position: fixed; inset: 0; background: rgba(12,14,19,.45); z-index: 39; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .side-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 40px; }
  .usermenu-name { display: none; }
  .usermenu-btn { padding: 4px; }
}

/* ---------- Estadísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: inherit; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.stat-label .ico { color: var(--blue-ink); }
.stat-value { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.1; margin-top: 8px; }
.stat-sub { font-size: 13px; color: var(--muted); }
.stat-hl { background: var(--ink); border-color: var(--ink); }
.stat-hl .stat-label, .stat-hl .stat-sub { color: #a3a8b5; }
.stat-hl .stat-label .ico { color: var(--yellow); }
.stat-hl .stat-value { color: #fff; }
@media (max-width: 1100px) { .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.cols-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .cols, .cols-even { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 20px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfcfa; white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfcfa; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--blue); text-decoration: underline; }
.table .sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }

@media (max-width: 720px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 16px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 13px; text-align: left; }
  .table.responsive td.actions { justify-content: flex-end; }
  .table.responsive td.actions::before { content: none; }
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters form { margin-left: auto; display: flex; gap: 8px; }
.filters .input { padding: 8px 12px; min-width: 220px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pager a, .pager span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-size: 14px; }
.pager span { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty p { margin-bottom: 16px; }

/* ---------- Detalle / lista de datos ---------- */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 15px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }
.prose { white-space: pre-wrap; word-break: break-word; }

.bar { height: 10px; background: var(--soft-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.bar.done span { background: var(--ok); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; min-width: 70px; }
.bar-row b { font-family: var(--mono); font-size: 13px; color: var(--ink); min-width: 38px; text-align: right; }

/* ---------- Proyectos (tarjetas) ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; text-decoration: none; color: inherit; display: grid; gap: 12px; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--line-2); color: inherit; }
.pcard h3 { font-size: 19px; margin: 0; }
.pcard-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pcard-meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }

/* ---------- Línea de tiempo y conversación ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 22px 26px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.timeline time { font-size: 13px; color: var(--muted); }
.timeline p { margin: 2px 0 0; white-space: pre-wrap; }

.thread { display: grid; gap: 14px; }
.msg { max-width: 82%; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.msg-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.msg-meta strong { color: var(--ink); }
.msg p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.msg.mine { justify-self: end; background: var(--blue-soft); border-color: #cddcff; }
.msg.staff { background: var(--yellow-soft); border-color: #f6dd8e; }
.msg.staff.mine { background: var(--yellow-soft); }

/* ---------- Editor de documentos ---------- */
.lines-table input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 14px; }
.lines-table td { padding: 8px 6px; vertical-align: top; }
.lines-table .c-desc { min-width: 240px; }
.lines-table .c-qty, .lines-table .c-iva { width: 90px; }
.lines-table .c-price { width: 120px; }
.lines-table .c-total { width: 120px; text-align: right; padding-top: 16px; font-variant-numeric: tabular-nums; }
.totals { margin-left: auto; width: min(320px, 100%); display: grid; gap: 6px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }

.inline-form { display: inline; margin: 0; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.hint { font-size: 14px; color: var(--muted); }

/* ---------- WhatsApp (panel admin) ---------- */
.pill-warn { background: #e8a400; } .pill-bad { background: var(--bad); }
.wa-status-row { font-size: 17px; }
.wa-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; }
.wa-count-bad { background: var(--bad); color: #fff; }
.chip.is-active .wa-count { box-shadow: 0 0 0 2px var(--ink); }
.wa-qr-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin: 20px 0 8px; }
.wa-qr { width: 264px; height: 264px; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; image-rendering: pixelated; }
.wa-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 320px; color: var(--text); }
.wa-code { font-size: 22px; letter-spacing: .08em; }
.wa-details summary { cursor: pointer; color: var(--blue-ink); font-weight: 500; font-size: 14px; margin-top: 8px; }
.wa-details[open] summary { margin-bottom: 4px; }
.wa-event { padding: 16px 0; border-top: 1px solid var(--line); }
.wa-event:first-of-type { border-top: 0; }
.wa-event .sub { display: block; font-weight: 400; margin-top: 2px; }
.wa-vars code { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.mono-area { font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.wa-pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; margin: 6px 0 0; color: var(--text); max-width: 560px; }
pre.wa-pre { background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.wa-err { color: var(--bad) !important; }
.wa-actions { white-space: nowrap; text-align: right; }
.wa-actions form { display: inline-block; margin-left: 4px; }
.wa-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.badge-wa-enviado { background: var(--ok-soft); color: var(--ok); }
.badge-wa-pendiente { background: var(--yellow-soft); color: #7a5600; }
.badge-wa-error { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 640px) { .wa-actions { text-align: left; } .wa-qr { width: 220px; height: 220px; } }
