/* =========================================================================
   Sistema de Gestión Empresarial — Hoja de estilos principal
   Tema oscuro moderno · Sin dependencias externas · Mobile first
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens de diseño
   ------------------------------------------------------------------------- */
:root {
    /* Fondo y superficies */
    --bg-base:      #080c17;
    --bg-1:         #0b1120;
    --bg-2:         #0f172a;
    --bg-3:         #111827;
    --surface-1:    rgba(17, 24, 39, 0.72);
    --surface-2:    rgba(30, 41, 59, 0.55);
    --surface-3:    rgba(15, 23, 42, 0.92);
    --glass:        rgba(30, 41, 59, 0.42);

    /* Bordes */
    --border:       rgba(148, 163, 184, 0.14);
    --border-soft:  rgba(148, 163, 184, 0.08);
    --border-glow:  rgba(99, 102, 241, 0.45);

    /* Texto */
    --text:         #e6edf8;
    --text-soft:    #b6c2d9;
    --muted:        #8b9ab5;
    --faint:        #7d8ca3;   /* >= 4.5:1 sobre fondo, tarjetas y sidebar */

    /* Marca */
    --brand:        #6366f1;
    --brand-2:      #8b5cf6;
    --brand-3:      #22d3ee;
    --brand-grad:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #22d3ee 130%);
    --brand-soft:   rgba(99, 102, 241, 0.14);

    /* Semánticos */
    --ok:           #22c55e;
    --ok-soft:      rgba(34, 197, 94, 0.14);
    --warn:         #f59e0b;
    --warn-soft:    rgba(245, 158, 11, 0.14);
    --bad:          #ef4444;
    --bad-soft:     rgba(239, 68, 68, 0.14);
    --info:         #38bdf8;
    --info-soft:    rgba(56, 189, 248, 0.14);

    /* Sombras */
    --shadow-sm:    0 1px 2px rgba(2, 6, 23, 0.4);
    --shadow-md:    0 8px 24px -12px rgba(2, 6, 23, 0.9);
    --shadow-lg:    0 24px 60px -24px rgba(2, 6, 23, 0.95);
    --shadow-brand: 0 10px 30px -12px rgba(99, 102, 241, 0.65);

    /* Métricas */
    --radius-sm:    10px;
    --radius:       14px;
    --radius-lg:    20px;
    --radius-xl:    26px;
    --sidebar-w:    268px;
    --topbar-h:     76px;
    --gap:          20px;
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --font:         "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --mono:         "JetBrains Mono", "SF Mono", Consolas, monospace;
}

/* -------------------------------------------------------------------------
   2. Reset y base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-1);
    overflow-x: hidden;                 /* sin scroll horizontal */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

/* Iconos SVG: alineación consistente dentro de texto y botones */
.icon {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}
/* Los contenedores flex se encargan del centrado vertical */
.btn .icon, .badge .icon, .chip .icon, .nav-pill .icon,
.kpi-icon .icon, .card-icon .icon, .service-icon .icon,
.wa-float .icon, .service-link .icon, .eyebrow .icon {
    display: block;
    vertical-align: middle;
}
.icon-solid { stroke: none; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; background: none; border: 0; }

ul, ol { list-style: none; }

code {
    font-family: var(--mono);
    font-size: 0.86em;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-soft);
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; }

::selection { background: rgba(99, 102, 241, 0.35); color: #fff; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border: 2px solid transparent;
    background-clip: content-box;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.35); background-clip: content-box; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: var(--mono); }
.hide { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------
   3. Fondo decorativo
   ------------------------------------------------------------------------- */
.bg-decor {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(1100px 600px at 12% -8%, rgba(99, 102, 241, 0.20), transparent 60%),
        radial-gradient(900px 520px at 92% 8%, rgba(34, 211, 238, 0.12), transparent 62%),
        radial-gradient(800px 500px at 60% 100%, rgba(139, 92, 246, 0.12), transparent 65%),
        var(--bg-1);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
}
.orb-1 {
    width: 460px; height: 460px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%);
    animation: float 18s ease-in-out infinite;
}
.orb-2 {
    width: 380px; height: 380px;
    bottom: -140px; right: -100px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 70%);
    animation: float 22s ease-in-out infinite reverse;
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(34px, 26px) scale(1.08); }
}

/* -------------------------------------------------------------------------
   4. Estructura general
   ------------------------------------------------------------------------- */
.app {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.main {
    flex: 1;
    min-width: 0;                      /* permite shrink dentro del flex */
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 26px 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* -------------------------------------------------------------------------
   5. Sidebar
   ------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: var(--sidebar-w);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 12, 23, 0.94));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    box-shadow: 18px 0 50px -30px rgba(0, 0, 0, 0.9);
    transition: transform 0.32s var(--ease-out);
}

.main { margin-left: var(--sidebar-w); }

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    border-radius: var(--radius);
    transition: transform 0.2s var(--ease);
}
.brand:hover { transform: translateX(2px); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-brand);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.brand-text small {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.nav-label {
    padding: 16px 12px 6px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}

.nav-list { display: flex; flex-direction: column; gap: 3px; }

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: 14.5px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: color 0.2s var(--ease), background 0.2s var(--ease),
                border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: rgba(148, 163, 184, 0.08);
    transform: translateX(3px);
}

.nav-link.is-active {
    color: #fff;
    background: linear-gradient(100deg, rgba(99, 102, 241, 0.24), rgba(34, 211, 238, 0.08));
    border-color: rgba(99, 102, 241, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px -12px rgba(99, 102, 241, 0.9);
}

.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--brand-grad);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.9);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(148, 163, 184, 0.1);
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-link.is-active .nav-icon {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-badge {
    flex-shrink: 0;
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 650;
    text-align: center;
    color: var(--text-soft);
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid var(--border-soft);
}
.nav-link.is-active .nav-badge {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: transparent;
}

.nav-link-ghost { color: var(--muted); font-size: 13.5px; }
.nav-link-ghost .nav-icon { width: 28px; height: 28px; }

.sidebar-foot { padding-top: 12px; border-top: 1px solid var(--border-soft); }

.user-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    background: var(--brand-grad);
    box-shadow: var(--shadow-sm);
}

.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-meta strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11.5px; color: var(--muted); }

.dot-online {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.06); }
}

.version {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--faint);
}

.sidebar-close { display: none; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.sidebar-overlay.is-visible { opacity: 1; }

/* -------------------------------------------------------------------------
   6. Topbar
   ------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 30px;
    background: rgba(11, 17, 32, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.topbar-head { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }

.topbar-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    color: #fff;
    background: var(--brand-soft);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.topbar-text { min-width: 0; }
.topbar-text h1 {
    font-size: 20px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-text p {
    font-size: 12.5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 99px;
    font-size: 12.5px;
    color: var(--text-soft);
    background: var(--glass);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.menu-btn { display: none; }

/* -------------------------------------------------------------------------
   7. Botones
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    background: var(--surface-2);
    white-space: nowrap;
    transition: transform 0.18s var(--ease), box-shadow 0.24s var(--ease),
                background 0.24s var(--ease), border-color 0.24s var(--ease),
                color 0.24s var(--ease), opacity 0.2s var(--ease);
}

.btn:hover { transform: translateY(-2px); background: rgba(148, 163, 184, 0.14); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
    color: #fff;
    background: var(--brand-grad);
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
    box-shadow: 0 16px 36px -14px rgba(99, 102, 241, 0.85);
    background: linear-gradient(135deg, #7c7ff5 0%, #9d6cf8 55%, #34d3ee 130%);
}

.btn-ghost {
    color: var(--text-soft);
    background: var(--glass);
    border-color: var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { color: #fff; border-color: var(--border-glow); }

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    box-shadow: 0 10px 26px -14px rgba(239, 68, 68, 0.9);
}
.btn-danger:hover { background: linear-gradient(135deg, #f45a5a, #e03131); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    color: var(--text-soft);
    background: var(--glass);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: #fff; background: rgba(148, 163, 184, 0.16); transform: translateY(-2px); }

/* Botones de acción en tablas y tarjetas */
.act {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--muted);
    border: 1px solid transparent;
    /* tambien se usan como <a> (ver factura, descargar, WhatsApp) */
    text-decoration: none;
    transition: all 0.18s var(--ease);
}
.act:hover { color: #fff; background: rgba(148, 163, 184, 0.16); transform: translateY(-2px); }
.act-edit:hover   { color: var(--info); background: var(--info-soft); border-color: rgba(56, 189, 248, 0.3); }
.act-del:hover    { color: var(--bad);  background: var(--bad-soft);  border-color: rgba(239, 68, 68, 0.3); }
.act-view:hover   { color: var(--ok);   background: var(--ok-soft);   border-color: rgba(34, 197, 94, 0.3); }
.act-jpg:hover    { color: var(--brand-2); background: var(--brand-soft); border-color: rgba(124, 58, 237, 0.32); }
.act-wa:hover     { color: #25d366; background: rgba(37, 211, 102, 0.12); border-color: rgba(37, 211, 102, 0.34); }

.actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* -------------------------------------------------------------------------
   8. Tarjetas
   ------------------------------------------------------------------------- */
.card {
    position: relative;
    min-width: 0;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(158deg, rgba(30, 41, 59, 0.62), rgba(15, 23, 42, 0.78));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease),
                box-shadow 0.3s var(--ease);
}
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.07), transparent 42%);
    pointer-events: none;
    opacity: 0.7;
}
.card > * { position: relative; z-index: 1; }

.card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.card-head h2 { font-size: 16.5px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.card-title-group { display: flex; align-items: center; gap: 11px; min-width: 0; }

.card-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--brand-soft);
    border: 1px solid var(--border);
}

/* -------------------------------------------------------------------------
   9. KPIs
   ------------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: var(--gap);
}

.kpi {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    min-width: 0;
}

.kpi::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--kpi-glow, rgba(99, 102, 241, 0.4)), transparent 68%);
    opacity: 0.5;
    filter: blur(14px);
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-out);
    pointer-events: none;
}
.kpi:hover::before { opacity: 0.85; transform: scale(1.14); }

.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.kpi-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--kpi-icon, var(--brand-grad));
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.9);
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.kpi-value {
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: #fff;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.kpi-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: auto;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
}
.trend-up   { color: var(--ok);   background: var(--ok-soft); }
.trend-down { color: var(--bad);  background: var(--bad-soft); }
.trend-flat { color: var(--muted); background: rgba(148, 163, 184, 0.12); }

.kpi-sub { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.kpi-sub b { color: var(--text-soft); font-weight: 600; }

.kpi-1 { --kpi-glow: rgba(99, 102, 241, 0.42); --kpi-icon: linear-gradient(135deg, #6366f1, #8b5cf6); }
.kpi-2 { --kpi-glow: rgba(34, 211, 238, 0.38); --kpi-icon: linear-gradient(135deg, #06b6d4, #3b82f6); }
.kpi-3 { --kpi-glow: rgba(34, 197, 94, 0.36);  --kpi-icon: linear-gradient(135deg, #10b981, #22c55e); }
.kpi-4 { --kpi-glow: rgba(245, 158, 11, 0.36); --kpi-icon: linear-gradient(135deg, #f59e0b, #f97316); }

/* -------------------------------------------------------------------------
   10. Rejillas de contenido
   ------------------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--gap); }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* -------------------------------------------------------------------------
   11. Gráfica de barras
   ------------------------------------------------------------------------- */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 250px;
    padding-top: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.bar-col {
    flex: 1 1 0;
    min-width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    justify-content: flex-end;
}

.bar-track {
    position: relative;
    width: 100%;
    max-width: 56px;
    flex: 1;
    display: flex;
    align-items: flex-end;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.07), rgba(148, 163, 184, 0.02));
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

/* Barras apiladas: cobrado + por cobrar */
.bar-track.is-stack {
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding-bottom: 2px;
}
.bar-track.is-stack .bar { border-radius: 8px 8px 3px 3px; }

.bar {
    position: relative;
    width: 100%;
    height: 0;
    border-radius: 10px 10px 6px 6px;
    background: var(--brand-grad);
    box-shadow: 0 -6px 22px -10px rgba(99, 102, 241, 0.85);
    transition: height 1.1s var(--ease-out), filter 0.25s var(--ease);
    animation: growUp 0.9s var(--ease-out) both;
}
.bar-pendiente {
    background: linear-gradient(180deg, #f59e0b, #b45309);
    box-shadow: 0 -6px 22px -10px rgba(245, 158, 11, 0.8);
}
.bar-col:hover .bar { filter: brightness(1.15) saturate(1.1); }

@keyframes growUp { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); } }

.bar-tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px);
    z-index: 5;
    width: max-content;
    max-width: 190px;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.22s var(--ease);
    z-index: 20;
}
.bar-tip strong { display: block; color: #fff; font-size: 13px; }
.bar-col:hover .bar-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.bar-label {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    font-size: 12.5px;
    color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   12. Gráfica de anillo (donut)
   ------------------------------------------------------------------------- */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.donut {
    --size: 168px;
    position: relative;
    width: var(--size);
    height: var(--size);
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--donut, rgba(148, 163, 184, 0.15)));
    box-shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.95);
    transition: transform 0.4s var(--ease-out);
}
.donut:hover { transform: scale(1.03); }
.donut::before {
    content: "";
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #172033, #0f172a);
    border: 1px solid var(--border-soft);
}
.donut-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-align: center;
}
.donut-center b { font-size: 23px; font-weight: 750; letter-spacing: -0.03em; }
.donut-center small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.donut-list { flex: 1; min-width: 175px; display: flex; flex-direction: column; gap: 11px; }
.donut-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 11px;
    transition: background 0.2s var(--ease);
}
.donut-row:hover { background: rgba(148, 163, 184, 0.08); }
.donut-row .label { flex: 1; min-width: 0; color: var(--text-soft); }
.donut-row .value { font-weight: 650; white-space: nowrap; }
.donut-row .pct { font-size: 12px; color: var(--muted); min-width: 42px; text-align: right; }

/* -------------------------------------------------------------------------
   13. Tablas
   ------------------------------------------------------------------------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

table.data {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

table.data thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-soft);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.2s var(--ease); }
table.data tbody tr:hover { background: rgba(99, 102, 241, 0.07); }
table.data td strong, table.data td b { color: var(--text); font-weight: 600; }
.table-foot-note { padding: 14px 16px 0; font-size: 12.5px; color: var(--faint); }

/* Celdas particulares */
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .avatar { width: 36px; height: 36px; border-radius: 11px; font-size: 12.5px; }
.cell-txt { display: flex; flex-direction: column; min-width: 0; }
.cell-txt strong { font-size: 14px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-txt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cell-contact { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; min-width: 0; }
.cell-contact span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-contact a { color: var(--text-soft); transition: color 0.2s var(--ease); }
.cell-contact a:hover { color: var(--brand); }

.amount {
    font-family: var(--mono);
    font-size: 14.5px;
    font-weight: 650;
    color: var(--text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.amount-lg { font-size: 17px; }
.amount-muted { color: var(--faint); text-decoration: line-through; }
.amount-ok { color: var(--ok); }
.amount-bad { color: var(--bad); }

/* -------------------------------------------------------------------------
   14. Badges y chips
   ------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 620;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-ok    { color: var(--ok);   background: var(--ok-soft);   border-color: rgba(34, 197, 94, 0.26); }
.badge-warn  { color: var(--warn); background: var(--warn-soft); border-color: rgba(245, 158, 11, 0.26); }
.badge-bad   { color: var(--bad);  background: var(--bad-soft);  border-color: rgba(239, 68, 68, 0.26); }
.badge-muted { color: var(--muted); background: rgba(148, 163, 184, 0.12); border-color: var(--border); }
.badge-brand { color: #c7d2fe; background: var(--brand-soft); border-color: rgba(99, 102, 241, 0.3); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-soft);
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-soft);
}
.chip-price { color: #a5f3fc; background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.22); }
.chip-muted { color: var(--faint); }

/* -------------------------------------------------------------------------
   15. Portafolio (tarjetas)
   ------------------------------------------------------------------------- */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--gap);
}

.project {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    min-width: 0;
}

/* .project fija display:flex, que gana contra el display:none que el
   navegador aplica a [hidden]. Sin esto el filtro del portafolio marcaba
   la tarjeta como oculta pero se seguia viendo. Esta regla va FUERA del
   bloque .project: si se cuela dentro, el CSS queda mal formado y el
   navegador descarta las reglas siguientes. */
.project[hidden] { display: none !important; }

.project-cover {
    position: relative;
    /* Cuadrada: la portada se guarda en 1000x1000 y así se ve completa */
    aspect-ratio: 1 / 1;
    height: auto;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    background: var(--g-cover, var(--brand-grad));
    overflow: hidden;
}
.project-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.32), transparent 46%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 12px, transparent 12px 24px);
}
.project-cover::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 60%;
    background: linear-gradient(180deg, transparent, rgba(8, 12, 23, 0.85));
}
.project-cover .cover-cat {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
    color: #fff;
    background: rgba(8, 12, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.project-star {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #fff;
    background: rgba(8, 12, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    fill: rgba(255, 255, 255, 0.35);
}
.project-star svg { fill: currentColor; }
.project-star.is-on { color: #fbbf24; }
.project-star.is-on svg { fill: #fbbf24; }

.project-body { display: flex; flex-direction: column; gap: 11px; padding: 20px; flex: 1; }
.project-body h3 { font-size: 16.5px; line-height: 1.3; }
.project-desc {
    font-size: 13.5px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.project-meta .sep { color: var(--faint); }
.project-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 20px 20px;
}

/* Gradientes para portadas y avatares */
.g0 { --g-cover: linear-gradient(135deg, #6366f1, #a855f7); }
.g1 { --g-cover: linear-gradient(135deg, #06b6d4, #3b82f6); }
.g2 { --g-cover: linear-gradient(135deg, #f59e0b, #ef4444); }
.g3 { --g-cover: linear-gradient(135deg, #10b981, #14b8a6); }
.g4 { --g-cover: linear-gradient(135deg, #ec4899, #8b5cf6); }
.g5 { --g-cover: linear-gradient(135deg, #64748b, #334155); }

.avatar.g0 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.avatar.g1 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.avatar.g2 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.avatar.g3 { background: linear-gradient(135deg, #10b981, #14b8a6); }
.avatar.g4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.avatar.g5 { background: linear-gradient(135deg, #64748b, #475569); }

/* -------------------------------------------------------------------------
   16. Listas de ranking
   ------------------------------------------------------------------------- */
.rank { display: flex; flex-direction: column; gap: 15px; }

.rank-item { display: flex; flex-direction: column; gap: 7px; }
.rank-top { display: flex; align-items: center; gap: 11px; }
.rank-pos {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-soft);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid var(--border-soft);
}
.rank-item:first-child .rank-pos {
    color: #fff;
    background: var(--brand-grad);
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}
.rank-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font-size: 13px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }

.progress {
    height: 7px;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--brand-grad);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
    transition: width 1.2s var(--ease-out);
}

/* Lista de actividad */
.list { display: flex; flex-direction: column; gap: 4px; }
.list-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border-radius: var(--radius);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.list-item:hover { background: rgba(148, 163, 184, 0.07); transform: translateX(3px); }
.list-item .avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 12.5px; }
.list-txt { flex: 1; min-width: 0; }
.list-txt strong { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-txt small { font-size: 12px; color: var(--muted); }
.list-end { text-align: right; flex-shrink: 0; }
.list-end .amount { display: block; font-size: 13.5px; }
.list-end small { font-size: 11.5px; color: var(--faint); }

/* -------------------------------------------------------------------------
   17. Toolbar / buscador
   ------------------------------------------------------------------------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(158deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.7));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 190px;
    padding: 0 14px;
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(8, 12, 23, 0.55);
    border: 1px solid var(--border);
    transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.22s var(--ease);
}
.search:focus-within {
    border-color: var(--border-glow);
    background: rgba(8, 12, 23, 0.75);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    color: var(--text-soft);
}
.search input {
    flex: 1;
    min-width: 0;
    padding: 11px 0;
    font-size: 14px;
    color: var(--text);
    background: none;
    border: 0;
    outline: none;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { display: grid; place-items: center; color: var(--muted); padding: 4px; border-radius: 6px; }
.search-clear:hover { color: var(--text); background: rgba(148, 163, 184, 0.15); }

/* -------------------------------------------------------------------------
   18. Formularios
   ------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: 0.01em;
}
.field .req { color: var(--bad); }
.field .hint { font-size: 11.5px; color: var(--faint); }
.field .err { font-size: 11.5px; color: var(--bad); display: none; }
.field.has-error .err { display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }

input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
input[type="number"], input[type="url"], input[type="date"], input[type="password"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text);
    background: rgba(8, 12, 23, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--border-glow);
    background: rgba(8, 12, 23, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

select {
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9ab5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
select option { background: #0f172a; color: var(--text); }

textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix > span {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--muted);
    pointer-events: none;
}
.input-prefix input { padding-left: 30px; }

.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    position: relative;
    width: 44px;
    height: 25px;
    flex-shrink: 0;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.22);
    border: 1px solid var(--border);
    transition: background 0.25s var(--ease);
}
.switch .track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.switch input:checked + .track { background: var(--brand); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .switch-label { font-size: 13.5px; color: var(--text-soft); }
.switch .switch-label small { display: block; font-size: 11.5px; color: var(--faint); }

/* -------------------------------------------------------------------------
   19. Modales
   ------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.26s var(--ease), visibility 0.26s var(--ease);
}
.modal.is-open { visibility: visible; opacity: 1; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    padding: 26px;
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, rgba(23, 32, 51, 0.98), rgba(13, 20, 35, 0.99));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    /* El panel es lo que se desplaza. Si el contenido es más alto que la
       pantalla, aquí aparece la barra para poder bajar (por ejemplo a la
       zona de subida de imágenes). */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateY(22px) scale(0.97);
    opacity: 0;
    transition: transform 0.34s var(--ease-out), opacity 0.28s var(--ease);
}
.modal.is-open .modal-panel { transform: translateY(0) scale(1); opacity: 1; }
.modal-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.65), transparent);
}

.modal-sm { max-width: 440px; text-align: center; padding: 32px 28px; }

.modal-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 17px;
    color: #fff;
}
.modal-icon-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 14px 30px -14px rgba(239, 68, 68, 0.9); }

.modal-title { font-size: 19px; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--muted); margin-bottom: 22px; }

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 4px;
    border-top: 1px solid var(--border-soft);
}
.modal-foot-center { justify-content: center; border: 0; padding-top: 4px; }
/* El formulario crece con su contenido; el desplazamiento lo hace el panel */
.modal-panel form {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}
/* Barra de scroll discreta dentro del modal */
.modal-panel::-webkit-scrollbar { width: 9px; }
.modal-panel::-webkit-scrollbar-track { background: transparent; }
.modal-panel::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.modal-panel::-webkit-scrollbar-thumb:hover { background-color: rgba(148, 163, 184, 0.5); }

body.modal-open { overflow: hidden; }

/* -------------------------------------------------------------------------
   20. Toasts
   ------------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    z-index: 200;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(370px, calc(100vw - 36px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: linear-gradient(150deg, rgba(23, 32, 51, 0.98), rgba(15, 23, 42, 0.98));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastIn 0.42s var(--ease-out) both;
}
.toast.is-out { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    color: #fff;
}
.toast-ok   .toast-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.toast-bad  .toast-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info .toast-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }

.toast-txt { flex: 1; min-width: 0; }
.toast-txt strong { display: block; font-size: 13.5px; font-weight: 650; }
.toast-txt small { font-size: 12.5px; color: var(--muted); word-break: break-word; }
.toast-close { color: var(--faint); padding: 2px; border-radius: 6px; }
.toast-close:hover { color: var(--text); background: rgba(148, 163, 184, 0.14); }

/* -------------------------------------------------------------------------
   21. Estado vacío
   ------------------------------------------------------------------------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 56px 24px;
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 4px;
    border-radius: 20px;
    color: var(--muted);
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed var(--border);
}
.empty h3 { font-size: 16px; }
.empty p { font-size: 13.5px; color: var(--muted); max-width: 380px; }
.empty .btn { margin-top: 6px; }

/* -------------------------------------------------------------------------
   22. Footer
   ------------------------------------------------------------------------- */
.site-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 22px 30px 28px;
    font-size: 12.5px;
    color: var(--faint);
    border-top: 1px solid var(--border-soft);
}

/* -------------------------------------------------------------------------
   23. Animaciones de entrada
   ------------------------------------------------------------------------- */
/* Las animaciones de entrada solo se activan si hay JavaScript:
   sin JS el contenido se muestra siempre (accesibilidad). */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(100deg, rgba(148, 163, 184, 0.06) 30%, rgba(148, 163, 184, 0.14) 50%, rgba(148, 163, 184, 0.06) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fila recién insertada */
.row-enter { animation: rowIn 0.45s var(--ease-out) both; }
@keyframes rowIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -------------------------------------------------------------------------
   24. Autenticación: login, recuperación y cuenta
   ------------------------------------------------------------------------- */
.auth-body {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 28px 18px;
}

.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.auth-card-wide { max-width: 500px; }

.auth-card {
    padding: 38px 32px 30px;
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, rgba(23, 32, 51, 0.96), rgba(13, 20, 35, 0.98));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.7), transparent);
}
.auth-card { position: relative; overflow: hidden; }

.auth-head { text-align: center; margin-bottom: 26px; }
.auth-mark { margin: 0 auto 16px; width: 54px; height: 54px; }
.auth-head h1 { font-size: 22px; letter-spacing: -0.03em; }
.auth-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.auth-card .form { gap: 17px; }
.auth-card .btn-block { padding: 13px 18px; font-size: 14.5px; margin-top: 4px; }

.auth-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
}
.auth-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s var(--ease);
}
.auth-links a:hover { color: var(--brand); }

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 11.5px;
    color: var(--faint);
    letter-spacing: 0.04em;
}

.auth-hint { margin-top: 20px; text-align: left; }

.auth-note {
    margin-top: 22px;
    padding: 15px 16px;
    border-radius: var(--radius);
    background: rgba(148, 163, 184, 0.07);
    border: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}
.auth-note p + p { margin-top: 8px; }
.auth-note-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-weight: 600;
    margin-bottom: 6px;
}

/* Campo de contraseña con botón de visibilidad */
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 46px; }
.password-toggle {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--faint);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.password-toggle:hover { color: var(--text); background: rgba(148, 163, 184, 0.14); }
.password-toggle.is-on { color: var(--brand); }

/* Datos de cuenta */
.account { display: flex; flex-direction: column; gap: 2px; }
.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}
.account-row:last-child { border-bottom: 0; }
.account-label { color: var(--muted); flex-shrink: 0; }
.account-value { color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }

.recovery-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 17px;
    border-radius: var(--radius);
    background: rgba(8, 12, 23, 0.6);
    border: 1px dashed rgba(99, 102, 241, 0.42);
}
.recovery-code {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #a5f3fc;
    background: none;
    padding: 0;
    user-select: all;
}

.card-danger-zone { border-color: rgba(239, 68, 68, 0.22); }
.card-danger-zone:hover { border-color: rgba(239, 68, 68, 0.45); }

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 9px;
    padding: 9px;
    border-radius: 11px;
    font-size: 12.5px;
    color: var(--muted);
    border: 1px solid var(--border-soft);
    transition: all 0.2s var(--ease);
}
.logout-link:hover {
    color: var(--text);
    background: rgba(148, 163, 184, 0.1);
    border-color: var(--border);
}

/* -------------------------------------------------------------------------
   24b. Sitio público: navegación, portada, servicios y contacto
   ------------------------------------------------------------------------- */
.site-body { background: var(--bg-1); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 300;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;
    background: #4f46e5;      /* más oscuro: el blanco encima pasa de 4.5:1 */
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

/* --- Barra de navegación --- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 70;
    padding: 14px 0;
    background: rgba(11, 17, 32, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
}
.site-nav.is-scrolled {
    padding: 10px 0;
    background: rgba(8, 12, 23, 0.88);
    border-bottom-color: var(--border);
}

.nav-inner { display: flex; align-items: center; gap: 18px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.nav-pill {
    position: relative;
    padding: 9px 15px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 550;
    color: var(--text-soft);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-pill:hover { color: #fff; background: rgba(148, 163, 184, 0.1); }
.nav-pill.is-active { color: #fff; background: var(--brand-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-burger { display: none; }
.nav-cta-mobile { display: none; }

/* --- Botón de WhatsApp --- */
.btn-wa {
    color: #fff;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-color: transparent;
    box-shadow: 0 10px 28px -14px rgba(37, 211, 102, 0.95);
}
.btn-wa:hover {
    background: linear-gradient(135deg, #2ee06f, #0f9e8c);
    box-shadow: 0 16px 34px -14px rgba(37, 211, 102, 1);
}
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: var(--radius); }

/* --- Botón flotante --- */
.wa-float-wrap {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    display: block;
}

.wa-float {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #25d366, #128c7e);
    box-shadow: 0 14px 34px -12px rgba(37, 211, 102, 0.9);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease);
}
.wa-float:hover { transform: scale(1.08); }
.wa-float::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.6);
    animation: waPulse 2.4s ease-out infinite;
}
@keyframes waPulse {
    0%   { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}

.wa-float-tip {
    position: absolute;
    right: 68px;
    bottom: 50%;
    transform: translateY(50%) translateX(8px);
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    color: var(--text);
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.24s var(--ease);
}
.wa-float-wrap:hover .wa-float-tip { opacity: 1; visibility: visible; transform: translateY(50%) translateX(0); }

/* --- Portada --- */
.hero { position: relative; padding: 70px 0 80px; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #c7d2fe;
    background: var(--brand-soft);
    border: 1px solid rgba(99, 102, 241, 0.32);
}

.hero h1, .page-head h1 {
    margin: 20px 0 0;
    font-size: clamp(32px, 5.4vw, 56px);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: #fff;
}

.grad-text {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-lead {
    margin-top: 20px;
    max-width: 540px;
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--text-soft);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--border-soft);
}
.hero-stat { display: flex; flex-direction: column; gap: 3px; }
.hero-stat b {
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.hero-stat span { font-size: 12.5px; color: var(--muted); }

/* Tarjetas visuales de la portada */
.hero-visual { position: relative; display: flex; flex-direction: column; gap: 18px; }

.hero-card {
    padding: 26px;
    border-radius: var(--radius-xl);
    background: linear-gradient(158deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.85));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.hero-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
    color: #bbf7d0;
    background: var(--ok-soft);
    border: 1px solid rgba(34, 197, 94, 0.28);
}
.hero-card-value {
    display: block;
    margin-top: 16px;
    font-size: clamp(30px, 4.4vw, 40px);
    font-weight: 750;
    letter-spacing: -0.04em;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.hero-card-label { font-size: 13.5px; color: var(--muted); }

.hero-card-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 84px;
    margin-top: 22px;
}
.hero-bar {
    flex: 1;
    border-radius: 6px 6px 3px 3px;
    background: var(--brand-grad);
    transform-origin: bottom;
    animation: growUp 1s var(--ease-out) both;
    min-height: 6px;
}

.hero-card-float {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    align-self: flex-start;
}
.hero-float-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #25d366, #128c7e);
}
.hero-card-float b { display: block; font-size: 14.5px; }
.hero-card-float small { font-size: 12.5px; color: var(--muted); }

/* --- Encabezado de página interior --- */
.page-head { padding: 52px 0 10px; text-align: center; }
.page-head .hero-lead { margin-left: auto; margin-right: auto; }
.page-head .hero-actions { justify-content: center; }

/* --- Secciones --- */
.section { padding: 62px 0; }
.section + .section { padding-top: 0; }

.section-head { max-width: 660px; margin: 0 auto 40px; text-align: center; }
.section-head h2 {
    margin-top: 16px;
    font-size: clamp(25px, 3.6vw, 36px);
    font-weight: 720;
    letter-spacing: -0.03em;
    color: #fff;
}
.section-head p { margin-top: 14px; font-size: 15.5px; color: var(--muted); line-height: 1.65; }
.section-more { display: flex; justify-content: center; margin-top: 38px; }

/* --- Servicios --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}
.service-card { display: flex; flex-direction: column; gap: 13px; }
.service-card h3 { font-size: 17.5px; }
.service-cat { align-self: flex-start; }

.service-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    background: var(--g-cover, var(--brand-grad));
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.9);
}
.service-desc { font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; }

.service-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}
.service-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 650;
    color: #25d366;
    transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}
.service-link:hover { gap: 9px; color: #2ee06f; }

/* --- Ventajas / pasos --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: var(--gap);
}
.feature-card { display: flex; flex-direction: column; gap: 12px; }
.feature-card h3 { font-size: 16.5px; }
.feature-card p { font-size: 13.8px; color: var(--muted); line-height: 1.6; }

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--gap);
}
.step-card { position: relative; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.step-num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0.85;
}
.step-card h3 { font-size: 16.5px; }
.step-card p { font-size: 13.8px; color: var(--muted); line-height: 1.6; }

/* --- Filtros del portafolio --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-bottom: 34px;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--glass);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}
.filter-pill:hover { color: #fff; border-color: var(--border-glow); transform: translateY(-2px); }
.filter-pill.is-active {
    color: #fff;
    background: var(--brand-grad);
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}
.filter-pill span {
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 11px;
    background: rgba(148, 163, 184, 0.18);
}
.filter-pill.is-active span { background: rgba(255, 255, 255, 0.22); }
.filters-note { text-align: center; margin-top: 20px; font-size: 13.5px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.client-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.client-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--glass);
    border: 1px solid var(--border);
}
.client-chip svg { color: var(--ok); }

/* --- Banda de CTA --- */
.cta-band {
    margin: 20px 0 0;
    padding: 54px 34px;
    border-radius: var(--radius-xl);
    text-align: center;
    background:
        radial-gradient(700px 300px at 50% 0%, rgba(37, 211, 102, 0.16), transparent 70%),
        linear-gradient(150deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.cta-inner { max-width: 760px; margin: 0 auto; }
.cta-text h2 { font-size: clamp(23px, 3.4vw, 32px); color: #fff; letter-spacing: -0.03em; }
.cta-text p { margin-top: 12px; font-size: 15.5px; color: var(--text-soft); line-height: 1.6; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* --- Contacto --- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--gap);
    align-items: start;
}
.contact-card { position: sticky; top: 96px; }

.form-preview {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(8, 12, 23, 0.6);
    border: 1px dashed var(--border);
}
.form-preview-label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.form-preview pre {
    margin-top: 9px;
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 170px;
    overflow-y: auto;
}

/* --- Vista previa de resultados de Google (Configuración → SEO) --- */
.seo-preview { display: flex; flex-direction: column; gap: 10px; }
.seo-serp {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    font-family: Arial, Helvetica, sans-serif;
}
.seo-serp-url {
    display: block;
    font-size: 12.5px;
    color: #202124;
    margin-bottom: 3px;
    word-break: break-all;
}
.seo-serp-title {
    display: block;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    color: #1a0dab;
    margin-bottom: 4px;
}
.seo-serp-desc {
    font-size: 13px;
    line-height: 1.58;
    color: #4d5156;
    margin: 0;
}

/* --- Encuadre de la portada: elegir qué parte se ve --- */
.social-rows { display: flex; flex-direction: column; gap: 12px; }
.social-row {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) auto;
    gap: 10px;
    align-items: end;
}
.social-remove { color: var(--faint); margin-bottom: 2px; }
.social-remove:hover { color: var(--bad); border-color: rgba(239, 68, 68, 0.4); }
.input-readonly { opacity: 0.7; cursor: default; }

.wa-big {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border-radius: var(--radius);
    color: var(--text);
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.14), rgba(18, 140, 126, 0.08));
    border: 1px solid rgba(37, 211, 102, 0.32);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.wa-big:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -18px rgba(37, 211, 102, 0.9); }
.wa-big-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #25d366, #128c7e);
}
.wa-big-txt { flex: 1; min-width: 0; }
.wa-big-txt b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.wa-big-txt small { font-size: 12.5px; color: var(--muted); }
.wa-big > svg { color: var(--muted); flex-shrink: 0; }

.account-value a { transition: color 0.2s var(--ease); }
.account-value a:hover { color: var(--brand); }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(8, 12, 23, 0.45);
    border: 1px solid var(--border-soft);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.faq-item[open] { border-color: rgba(99, 102, 241, 0.4); background: rgba(99, 102, 241, 0.07); }
.faq-item summary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex-shrink: 0; color: var(--muted); transition: transform 0.25s var(--ease); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { margin-top: 11px; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* --- Pie del sitio --- */
.site-footer {
    position: relative;
    margin-top: 40px;
    padding: 60px 0 28px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(6, 10, 20, 0.98));
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 -24px 60px -40px rgba(0, 0, 0, 0.95);
}
.site-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), rgba(34, 211, 238, 0.35), transparent);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 38px;
}
.footer-col h3 {
    margin-bottom: 15px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}
.footer-desc { margin-top: 15px; font-size: 13.5px; color: var(--muted); line-height: 1.65; max-width: 280px; }
/* gap menor: los enlaces grew min-height 26px, asi el pie no queda mas alto */
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 4px; }
.footer-links a, .footer-contact a, .footer-contact span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Zona táctil cómoda: al menos 26 px de alto */
    min-height: 26px;
    font-size: 13.5px;
    color: var(--text-soft);
    transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer-links a:hover, .footer-contact a:hover { color: #fff; transform: translateX(3px); }
.footer-contact svg { color: var(--muted); flex-shrink: 0; }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
    font-size: 12.5px;
    color: var(--faint);
}
.footer-socials { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-socials a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;           /* zona táctil cómoda */
    color: var(--muted);
    transition: color 0.2s var(--ease);
}
.footer-socials a:hover { color: #fff; }

/* -------------------------------------------------------------------------
   25. Galería de proyectos: subida, miniaturas y visor (lightbox)
   ------------------------------------------------------------------------- */
.project-cover.has-image::before { opacity: 0; }
.project-cover.has-image::after {
    background: linear-gradient(180deg, rgba(8, 12, 23, 0.25) 0%, rgba(8, 12, 23, 0.85) 100%);
}
.project-cover .cover-cat,
.project-cover .project-star,
.project-cover .cover-count { z-index: 3; }

.cover-count {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
    color: #fff;
    background: rgba(8, 12, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.22s var(--ease), background 0.22s var(--ease);
}
.cover-count span {
    padding: 1px 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
}
.cover-count:hover { transform: translateY(-2px); background: rgba(8, 12, 23, 0.8); }
.cover-count:hover .icon { color: #a5f3fc; }

/* --- Zona de subida (panel) --- */
.image-zone {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(8, 12, 23, 0.5);
    border: 1px dashed rgba(99, 102, 241, 0.38);
}
.image-zone-head { display: flex; align-items: center; gap: 13px; }
.image-zone-head h4 { font-size: 15px; }
.image-zone-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.image-zone input[type="file"] {
    width: 100%;
    padding: 11px 13px;
    font-size: 13px;
    color: var(--text-soft);
    background: rgba(8, 12, 23, 0.65);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.image-zone input[type="file"]:hover { border-color: var(--brand); background: rgba(99, 102, 241, 0.07); }
.image-zone input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: var(--brand-grad);
    border: 0;
    cursor: pointer;
}

.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 15px;
    border-radius: var(--radius);
    background: rgba(8, 12, 23, 0.45);
    border: 1px solid var(--border-soft);
    text-align: center;
    font-size: 12.5px;
    color: var(--faint);
}
.upload-drop img {
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.upload-drop .image-name { font-size: 12px; color: var(--muted); }

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.image-item {
    display: flex;
    flex-direction: column;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(8, 12, 23, 0.6);
}
.image-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.5);
}
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-tag {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
}
.image-del {
    position: absolute;
    right: 6px;
    top: 6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: #fff;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(239, 68, 68, 0.45);
    opacity: 0;
    transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.image-item:hover .image-del { opacity: 1; }
.image-del:hover { background: var(--bad); }

/* Botón para guardar la descripción de la imagen */
.image-save {
    position: absolute;
    right: 36px;
    top: 6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: var(--ok);
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(34, 197, 94, 0.45);
    opacity: 0;
    transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.image-item:hover .image-save,
.image-item:focus-within .image-save { opacity: 1; }
.image-save:hover { background: var(--ok); color: #06240f; }
.image-save.is-saving { opacity: 1; pointer-events: none; color: var(--muted); }

/* Campo de texto con la descripción de la imagen */
.image-cap {    width: 100%;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: rgba(2, 6, 23, 0.55);
    padding: 7px 9px;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--text-soft);
}
.image-cap::placeholder { color: var(--faint); }
.image-cap:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.45);
}

/* --- Recortador de portada: recorte cuadrado --- */
.recorte {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.recorte[hidden] { display: none; }

.recorte__box {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(160deg, rgba(23, 32, 51, 0.99), rgba(13, 20, 35, 1));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px 22px 18px;
    box-shadow: var(--shadow-lg);
}

.recorte__cab { text-align: center; margin-bottom: 16px; }
.recorte__cab h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.recorte__cab p  { margin: 0; font-size: 12.5px; color: var(--muted); }

/* El visor: un cuadrado fijo. La imagen se arrastra por detrás. */
.recorte__area {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: #05080f;
    border: 1px solid var(--border);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.recorte__area:active { cursor: grabbing; }
.recorte__area img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    /* Escala desde la esquina: si fuera desde el centro, la posición
       arrastrada no coincidiría con la región recortada. */
    transform-origin: 0 0;
    pointer-events: none;
    will-change: transform;
}

/* Regla de tercios, para centrar bien */
.recorte__marco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.22) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
    background-position: 0 0;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.9);
}
.recorte__grip {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
}
.recorte__grip--nw { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.recorte__grip--ne { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.recorte__grip--sw { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.recorte__grip--se { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.recorte__pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.recorte__tam { font-size: 12px; color: var(--faint); }
.recorte__acciones { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 420px) {
    .recorte__box { max-width: 100%; padding: 16px; }
    .recorte__acciones { width: 100%; }
    .recorte__acciones .btn { flex: 1; }
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}
.lightbox.is-open { visibility: visible; opacity: 1; }

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lb-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    /* Alto definido: si solo tuviera max-height, el panel mediría lo que
       mida su contenido y la zona de la imagen se quedaría sin espacio
       cuando la imagen es alta (va posicionada, no ocupa flujo). */
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}
.lb-info { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.lb-info strong {
    font-size: 15.5px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-count { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.lb-stage {
    flex: 1;
    min-height: 0;
    position: relative;              /* referencia para la imagen */
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: rgba(8, 12, 23, 0.6);
    border: 1px solid var(--border);
}
/* La imagen ocupa exactamente el visor y se ajusta dentro sin deformarse.
   Con position:absolute + inset:0 el alto en % sí se resuelve, así que
   una captura de 700x2600 se reduce y se ve COMPLETA. */
.lb-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.25s var(--ease);
}
/* Al tocar la imagen se amplía ×2 y el visor se vuelve desplazable.
   El tamaño exacto lo calcula gallery.js; aquí solo se permite el
   desbordamiento y se ancla arriba a la izquierda para poder recorrerla. */
.lightbox.is-zoomed .lb-stage { overflow: auto; cursor: zoom-out; }
.lightbox.is-zoomed .lb-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

/* Texto que explica la captura (ej. "Panel de administración") */
.lb-desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 20px 15px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    color: #f1f5f9;
    text-align: center;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.88) 55%);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    pointer-events: none;
}
.lb-desc.is-visible { opacity: 1; transform: translateY(0); }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.lb-nav:hover { background: var(--brand); }
.lb-prev { left: 14px; }
.lb-prev .icon { transform: rotate(90deg); }
.lb-next { right: 14px; }
.lb-next .icon { transform: rotate(-90deg); }

.lb-thumbs {
    display: flex;
    gap: 9px;
    justify-content: center;
    flex-shrink: 0;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.lb-thumb {
    width: 68px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 9px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.2s var(--ease);
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: 0.85; }
.lb-thumb.is-active { opacity: 1; border-color: var(--brand); }

/* -------------------------------------------------------------------------
   26. Alertas
   ------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 17px;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.5;
    border: 1px solid transparent;
}
.alert > svg { flex-shrink: 0; }
.alert > span { flex: 1; min-width: 0; }
.alert b { color: inherit; font-weight: 700; }

.alert-bad {
    color: #fecaca;
    background: var(--bad-soft);
    border-color: rgba(239, 68, 68, 0.32);
}
.alert-ok {
    color: #bbf7d0;
    background: var(--ok-soft);
    border-color: rgba(34, 197, 94, 0.32);
}
.alert-warn {
    color: #fde68a;
    background: var(--warn-soft);
    border-color: rgba(245, 158, 11, 0.32);
}
.alert .btn { flex-shrink: 0; }

/* -------------------------------------------------------------------------
   26. Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1280px) {
    .content { padding: 24px 24px 36px; }
    .topbar { padding: 14px 24px; }
    .grid-2 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
}

@media (max-width: 1100px) {
    :root { --gap: 18px; }
    .grid-2, .grid-2-even { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .hero-visual { max-width: 520px; }
    .contact-grid { grid-template-columns: minmax(0, 1fr); }
    .contact-card { position: static; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: min(290px, 86vw);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-close { display: grid; }
    .main { margin-left: 0; }
    .menu-btn { display: grid; }
    .topbar { gap: 12px; }
    .topbar-icon { display: none; }
    .hide-sm { display: none; }
    .btn-sm { padding: 9px 12px; }
}

@media (max-width: 700px) {
    body { font-size: 14.5px; }
    .content { padding: 18px 16px 30px; gap: 18px; }
    .topbar { padding: 12px 16px; min-height: 66px; }
    .topbar-text h1 { font-size: 17.5px; }
    .topbar-text p { display: none; }
    .date-chip { display: none; }
    .kpi-grid { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .card { padding: 18px; border-radius: var(--radius); }
    .toolbar { padding: 14px; gap: 10px; }
    .toolbar-actions { width: 100%; margin-left: 0; }
    .toolbar-actions .btn { flex: 1; }
    .search { width: 100%; }
    .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
    .modal { padding: 0; align-items: flex-end; }
    .modal-panel {
        max-width: 100%;
        max-height: 94dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 22px 18px;
        transform: translateY(100%);
    }
    .modal.is-open .modal-panel { transform: translateY(0); }
    .modal-sm { text-align: center; }
    .modal-foot .btn { flex: 1; }
    .toast-stack { top: auto; bottom: 14px; right: 14px; left: 14px; width: auto; }
    .toast { animation: toastUp 0.4s var(--ease-out) both; }
    @keyframes toastUp {
        from { opacity: 0; transform: translateY(30px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .toast.is-out { animation: toastOutDown 0.3s var(--ease) forwards; }
    @keyframes toastOutDown { to { opacity: 0; transform: translateY(30px); } }
    .projects { grid-template-columns: minmax(0, 1fr); }
    .chart { height: 210px; gap: 6px; }
    .donut-wrap { justify-content: center; }
    .site-foot { padding: 18px 16px 24px; justify-content: center; text-align: center; }
    .kpi-value { font-size: 30px; }

    /* Sitio público en móvil */
    .container { padding: 0 18px; }
    .nav-burger { display: grid; }
    .nav-actions .btn-wa { display: none; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px;
        border-radius: var(--radius-lg);
        background: rgba(11, 17, 32, 0.98);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    .site-nav.is-open .nav-links { display: flex; }
    .nav-pill { padding: 12px 16px; }
    .nav-cta-mobile { display: inline-flex; margin-top: 8px; justify-content: center; }

    .hero { padding: 44px 0 54px; }
    .page-head { padding: 38px 0 6px; }
    .section { padding: 44px 0; }
    .hero-stats { gap: 24px; }
    .hero-stat b { font-size: 23px; }
    .hero-actions .btn { flex: 1; min-width: 160px; }
    .section-head { margin-bottom: 30px; }
    .cta-band { padding: 40px 20px; border-radius: var(--radius-lg); }
    .cta-actions .btn { flex: 1; min-width: 170px; }
    .wa-float-wrap { right: 16px; bottom: 16px; }
    .wa-float { width: 54px; height: 54px; }
    .wa-float-tip { display: none; }
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .form-preview pre { max-height: 130px; }
    .social-row { grid-template-columns: minmax(0, 1fr) auto; }
    .social-row .field:first-child { grid-column: 1; }
    .social-row .field:nth-child(2) { grid-column: 1; }
    .social-remove { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .seo-serp-title { font-size: 16px; }

    /* Galería en móvil */
    .lightbox { padding: 12px; }
    .lb-nav { width: 40px; height: 40px; }
    .lb-prev { left: 6px; }
    .lb-next { right: 6px; }
    .lb-thumb { width: 54px; height: 38px; }
    .image-zone { padding: 15px; }
    .image-list { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .image-del { opacity: 1; }
    .auth-body { padding: 18px 14px; }
    .auth-card { padding: 28px 20px 24px; border-radius: var(--radius-lg); }
    .auth-head h1 { font-size: 20px; }
    .alert { flex-wrap: wrap; padding: 13px 14px; }
    .alert .btn { width: 100%; }
    .recovery-box { flex-direction: column; align-items: stretch; text-align: center; }
    .recovery-code { font-size: 16px; }
}

@media (max-width: 420px) {
    .kpi { padding: 18px; }
    .kpi-value { font-size: 27px; }
    .btn { padding: 10px 14px; font-size: 13.5px; }
    .toolbar-actions .btn span { display: none; }
    .toolbar-actions .btn { flex: 0 0 auto; padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Utilidades */
.hide-desktop { display: inline-flex; }
@media (max-width: 900px) { .hide-desktop { display: none; } }
