/* ===========================================================
   Junin Services — site.css
   Diseño: Servicios Ambientales Premium
   =========================================================== */

/* ── 1. TOKENS ──────────────────────────────────────────── */
:root {
    /* Verdes */
    --g:       #16a34a;
    --g-d:     #0d8a3e;
    --g-xs:    #f0fdf4;
    --g-sm:    #dcfce7;
    --g-300:   #86efac;
    --g-400:   #4ade80;

    /* Tintas */
    --ink:     #0f1912;
    --ink-m:   #374151;
    --ink-s:   #6b7280;
    --ink-xs:  #9ca3af;

    /* Superficies */
    --surface: #ffffff;
    --bg:      #f8fafb;
    --line:    #e5e7eb;
    --line-s:  #f3f4f6;

    /* Oscuros (hero / sidebar) */
    --dark:    #060e08;
    --dark-2:  #0b1810;
    --dark-3:  #122116;

    /* Layout */
    --sidebar-w: 252px;
    --topbar-h:  60px;

    /* Radios */
    --r:    .875rem;
    --r-sm: .5rem;
    --r-xs: .3rem;

    /* Sombras */
    --sh-xs: 0 1px 2px rgba(0,0,0,.06);
    --sh-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --sh:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --sh-lg: 0 16px 48px rgba(0,0,0,.14), 0 6px 16px rgba(0,0,0,.06);

    /* Transición global */
    --t: .18s ease;
}

/* ── 2. BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
input, select, textarea { max-width: 100%; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. LANDING PÚBLICA
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── 3a. Navbar fija ────────────────────────────────────── */
.pub-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1.1rem 0;
    transition: background var(--t), box-shadow var(--t), padding var(--t);
}

.pub-nav.scrolled {
    background: rgba(6,14,8,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(255,255,255,.05);
    padding: .65rem 0;
}

.pub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pub-nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
    flex-shrink: 0;
    white-space: nowrap;
}
.pub-nav-brand img { height: 28px; }
.pub-nav-brand:hover { color: var(--g-300); }

.pub-nav-links {
    display: flex;
    gap: .1rem;
    flex: 1;
}

.pub-nav-link {
    padding: .38rem .8rem;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    border-radius: var(--r-xs);
    transition: color var(--t), background var(--t);
    white-space: nowrap;
}
.pub-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}

.pub-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.pub-nav-login {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    padding: .38rem .9rem;
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: var(--r-sm);
    transition: border-color var(--t), color var(--t), background var(--t);
    white-space: nowrap;
}
.pub-nav-login:hover {
    border-color: rgba(255,255,255,.5);
    color: #fff;
    background: rgba(255,255,255,.05);
}

.pub-nav-cta {
    background: var(--g);
    color: #fff;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
    padding: .42rem 1.1rem;
    border-radius: var(--r-sm);
    border: 1.5px solid transparent;
    transition: background var(--t);
    white-space: nowrap;
}
.pub-nav-cta:hover { background: var(--g-d); color: #fff; }

/* Hamburger */
.pub-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
}
.pub-nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}

@media (max-width: 767px) {
    .pub-nav-toggle { display: flex; }
    .pub-nav-links {
        display: none;
        position: fixed;
        top: 56px; left: 0; right: 0;
        background: rgba(6,14,8,.97);
        flex-direction: column;
        padding: 1.25rem 2rem 1.5rem;
        gap: .15rem;
        border-top: 1px solid rgba(255,255,255,.06);
        box-shadow: 0 8px 24px rgba(0,0,0,.25);
    }
    .pub-nav-links.open { display: flex; }
    .pub-nav-link { font-size: .95rem; padding: .65rem .75rem; }
    .pub-nav-actions { display: none; }
}

/* ── 3b. Contenedor paginado ────────────────────────────── */
/* Páginas no-landing (login, etc.) necesitan offset de nav fija */
.pub-page-pad {
    padding-top: 80px;
    min-height: 85vh;
}

/* ── 3c. Hero ───────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background:
        linear-gradient(155deg, rgba(6,14,8,.7) 0%, rgba(6,14,8,.55) 55%, rgba(6,14,8,.78) 100%),
        url('/Images/hero.jpg') center/cover no-repeat;
    color: #fff;
    padding: 9rem 0 6rem;
}

.pub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: rgba(22,163,74,.15);
    border: 1px solid rgba(22,163,74,.32);
    color: var(--g-300);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .3rem .85rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
}
.hero-tag-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--g-400);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
    margin-bottom: 1.25rem;
    max-width: 680px;
}
.hero-accent { color: var(--g-400); display: block; margin-top: .2rem; }

.hero .lead {
    font-size: 1.08rem;
    color: rgba(255,255,255,.7);
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 3.5rem;
}

.hero-btn-primary {
    background: var(--g);
    color: #fff;
    padding: .78rem 1.8rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background var(--t), transform var(--t);
    box-shadow: 0 4px 22px rgba(22,163,74,.38);
}
.hero-btn-primary:hover { background: var(--g-d); color: #fff; transform: translateY(-1px); }

.hero-btn-outline {
    background: transparent;
    color: rgba(255,255,255,.85);
    padding: .78rem 1.5rem;
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: 2px solid rgba(255,255,255,.22);
    transition: border-color var(--t), color var(--t);
}
.hero-btn-outline:hover { border-color: rgba(255,255,255,.55); color: #fff; }

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
.hero-stat-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -.025em;
}
.hero-stat-lbl {
    font-size: .72rem;
    color: rgba(255,255,255,.48);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-top: .3rem;
}

/* ── 3d. Secciones base ─────────────────────────────────── */
.pub-section     { padding: 5.5rem 0; background: var(--bg); }
.pub-section-alt { padding: 5.5rem 0; background: var(--surface); }
.pub-section-dark {
    padding: 5.5rem 0;
    background: var(--dark);
}

.section-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--g);
    margin-bottom: .5rem;
}
.section-title {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.18;
    color: var(--ink);
    margin-bottom: .6rem;
}
.section-sub {
    font-size: .97rem;
    color: var(--ink-s);
    line-height: 1.65;
    max-width: 500px;
    margin-bottom: 0;
}

/* ── 3e. Servicios ──────────────────────────────────────── */
.service-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: box-shadow var(--t), transform var(--t);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.service-card:hover { box-shadow: var(--sh); transform: translateY(-3px); }

.service-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.service-card-body {
    padding: 1.35rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.service-card-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--g-xs);
    color: #166534;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .22rem .65rem;
    border-radius: 2rem;
    border: 1px solid var(--g-sm);
    width: fit-content;
}

.service-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
    margin: 0;
}
.service-card p {
    font-size: .875rem;
    color: var(--ink-s);
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

/* ── 3f. Cómo funciona ──────────────────────────────────── */
.steps-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    position: relative;
    margin-top: 2.5rem;
}

.steps-wrap::before {
    content: "";
    position: absolute;
    top: 1.25rem;
    left: calc(var(--sidebar-w) / 2 - 1200px);
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--line) 10%,
        var(--line) 90%,
        transparent);
    z-index: 0;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 1;
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--t), transform var(--t);
}
.step-card:hover { box-shadow: var(--sh-sm); transform: translateY(-2px); }

.step-num {
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    background: var(--g);
    color: #fff;
    font-size: .875rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(22,163,74,.3);
}

.step-card h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 .4rem;
    letter-spacing: -.01em;
}
.step-card p {
    font-size: .84rem;
    color: var(--ink-s);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 767px) {
    .steps-wrap {
        grid-template-columns: 1fr 1fr;
    }
    .steps-wrap::before { display: none; }
}
@media (max-width: 479px) {
    .steps-wrap { grid-template-columns: 1fr; }
}

/* ── 3g. Portefólio ─────────────────────────────────────── */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-top: 2.5rem;
}

.insta-thumb {
    position: relative;
    overflow: hidden;
    display: block;
    border-radius: var(--r-sm);
    cursor: pointer;
    background: #000;
    aspect-ratio: 1 / 1;
}

.insta-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease, filter .35s ease;
}

.insta-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background .3s;
    z-index: 1;
}

.insta-thumb:hover .insta-video { transform: scale(1.06); filter: brightness(.85); }
.insta-thumb:hover::after { background: rgba(0,0,0,.2); }

.insta-play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    color: rgba(255,255,255,.92);
    text-shadow: 0 2px 12px rgba(0,0,0,.7);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}
.insta-thumb.paused .insta-play-icon { opacity: 1; }

@media (max-width: 991px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px)  { .portfolio-grid { gap: .4rem; } }

/* ── 3h. CTA / Contacto ─────────────────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--dark) 0%, #0c2012 50%, var(--dark) 100%);
    padding: 7rem 0;
    color: #fff;
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.12;
    max-width: 660px;
    margin: 0 auto .9rem;
}

.cta-section p.lead {
    color: rgba(255,255,255,.55);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
}

.cta-btn-primary {
    background: var(--g);
    color: #fff;
    padding: .82rem 1.85rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background var(--t), transform var(--t);
    box-shadow: 0 4px 22px rgba(22,163,74,.32);
}
.cta-btn-primary:hover { background: var(--g-d); color: #fff; transform: translateY(-1px); }

.cta-btn-outline {
    background: transparent;
    color: rgba(255,255,255,.82);
    padding: .82rem 1.5rem;
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: 2px solid rgba(255,255,255,.2);
    transition: border-color var(--t), color var(--t);
}
.cta-btn-outline:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* ── 3i. Footer ─────────────────────────────────────────── */
.pub-footer {
    background: #030704;
    border-top: 1px solid rgba(255,255,255,.04);
    padding: 2.25rem 0;
    font-size: .82rem;
}

.pub-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.pub-footer-copy { color: rgba(255,255,255,.32); }

.pub-footer-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.pub-footer-links a {
    color: rgba(255,255,255,.4);
    text-decoration: none;
    transition: color var(--t);
}
.pub-footer-links a:hover { color: var(--g-300); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. APP SHELL (zona de documentos)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

body.app-shell {
    background: var(--bg);
    min-height: 100vh;
}

/* ── 4a. Sidebar ────────────────────────────────────────── */
.app-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--dark-2);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.app-sidebar-logo {
    padding: 1.2rem 1rem .9rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: -.01em;
}
.app-sidebar-brand:hover { color: var(--g-300); }
.app-sidebar-brand img { height: 26px; flex-shrink: 0; }

.app-sidebar-section-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
    padding: .9rem 1.1rem .25rem;
}

.app-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .35rem .6rem;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .58rem .8rem;
    border-radius: var(--r-sm);
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    transition: background var(--t), color var(--t);
    margin-bottom: .1rem;
    white-space: nowrap;
}
.app-sidebar-link:hover {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.88);
}
.app-sidebar-link.active {
    background: rgba(22,163,74,.14);
    color: var(--g-300);
    font-weight: 600;
}

.app-sidebar-link svg {
    width: 17px; height: 17px;
    flex-shrink: 0;
    opacity: .7;
    stroke-width: 1.75;
}
.app-sidebar-link.active svg,
.app-sidebar-link:hover svg { opacity: 1; }

.app-sidebar-link--dim { color: rgba(255,255,255,.35); }

.app-sidebar-foot {
    padding: .6rem .6rem .9rem;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.app-sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .55rem .8rem;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,.04);
    margin-top: .35rem;
}

.app-sidebar-user-name {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-logout {
    background: none;
    border: 1px solid rgba(255,255,255,.13);
    color: rgba(255,255,255,.45);
    font-size: .72rem;
    padding: .2rem .55rem;
    border-radius: var(--r-xs);
    cursor: pointer;
    transition: border-color var(--t), color var(--t);
    white-space: nowrap;
    font-family: inherit;
}
.app-sidebar-logout:hover {
    border-color: rgba(255,255,255,.3);
    color: rgba(255,255,255,.8);
}

/* Overlay móvil */
.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1099;
    backdrop-filter: blur(2px);
}

/* ── 4b. Área de contenido ──────────────────────────────── */
.app-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── 4c. Topbar (sólo móvil) ────────────────────────────── */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    box-shadow: var(--sh-xs);
}

.app-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.app-menu-btn span {
    display: block;
    width: 20px; height: 2px;
    background: var(--ink-m);
    border-radius: 2px;
    transition: transform .2s;
}

.app-topbar-title {
    font-size: .92rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -.01em;
}

/* ── 4d. Contenido principal ────────────────────────────── */
.app-main { flex: 1; padding: 2rem 0 4rem; }

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* ── 4e. Sidebar móvil ──────────────────────────────────── */
@media (max-width: 991px) {
    .app-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .app-sidebar.open { transform: translateX(0); }
    .app-sidebar-overlay.open { display: block; }
    .app-content { margin-left: 0; }
    .app-menu-btn { display: flex; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. COMPONENTES COMPARTIDOS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── 5a. Page header ────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.page-header h1,
.page-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.018em;
    color: var(--ink);
}

/* ── 5b. Grid y tarjetas de documento ───────────────────── */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.doc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-xs);
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--t), transform var(--t);
}
.doc-card:hover { box-shadow: var(--sh); transform: translateY(-1px); }

.doc-card-head {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line-s);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.doc-card-title {
    font-weight: 700;
    font-size: .875rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
}
.doc-card-body  { padding: .9rem 1rem; flex: 1; }
.doc-card-foot  {
    padding: .7rem 1rem;
    border-top: 1px solid var(--line-s);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.doc-card-id { color: var(--ink-xs); font-size: .72rem; }
.doc-meta    { font-size: .8rem; color: var(--ink-s); line-height: 1.65; margin: 0; }

/* ── 5c. Badges de estado ───────────────────────────────── */
.badge-estado {
    display: inline-block;
    padding: .22rem .65rem;
    border-radius: 2rem;
    font-size: .69rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
    letter-spacing: .03em;
}
.badge-estado.rascunho {
    background: #fef9c3;
    border-color: #fde047;
    color: #713f12;
}
.badge-estado.emitido {
    background: var(--g-xs);
    border-color: var(--g-sm);
    color: #14532d;
}

/* ── 5d. Detalle de documento ───────────────────────────── */
.doc-detail-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.doc-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line-s);
}

.doc-meta-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .3rem .75rem;
    font-size: .875rem;
}
.doc-meta-grid dt { color: var(--ink-s); font-weight: 500; }
.doc-meta-grid dd { margin: 0; }

/* ── 5e. Acciones ───────────────────────────────────────── */
.doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-s);
    align-items: center;
}

/* ── 5f. Formulario ─────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-sm);
    padding: 1.5rem;
    max-width: 720px;
}

/* ── 5g. Panel QR ───────────────────────────────────────── */
.qr-panel {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 1rem;
    text-align: center;
}
.qr-panel img { max-width: 160px; }
.qr-panel .qr-url {
    font-size: .7rem;
    word-break: break-all;
    color: var(--ink-s);
    margin-top: .5rem;
}

/* ── 5h. Texto documento ────────────────────────────────── */
.doc-texto {
    white-space: pre-wrap;
    font-size: .9rem;
    line-height: 1.7;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 1rem;
}

/* ── 5i. Hash ───────────────────────────────────────────── */
.hash-code {
    font-family: "Courier New", monospace;
    font-size: .7rem;
    word-break: break-all;
    color: var(--ink-s);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    padding: .2rem .4rem;
    display: block;
}

/* ── 5j. Banners ────────────────────────────────────────── */
.doc-emitido-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--g-xs);
    border: 1px solid var(--g-sm);
    border-radius: var(--r-sm);
    padding: .75rem 1rem;
    color: #14532d;
    font-size: .875rem;
    margin-bottom: 1rem;
}
.doc-rascunho-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: var(--r-sm);
    padding: .75rem 1rem;
    color: #713f12;
    font-size: .875rem;
    margin-bottom: 1rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. ASISTENTE IA FLOTANTE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ia-fab {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--g);
    color: #fff;
    border: none;
    box-shadow: 0 4px 18px rgba(22,163,74,.42);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 2000;
    transition: background var(--t), transform var(--t);
}
.ia-fab:hover { background: var(--g-d); transform: scale(1.07); }

.ia-panel {
    position: fixed;
    bottom: 4.5rem; right: 1.5rem;
    width: 360px;
    max-height: 560px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    transition: opacity .2s, transform .2s;
}
.ia-panel.ia-hidden {
    opacity: 0;
    transform: translateY(12px) scale(.97);
    pointer-events: none;
}

.ia-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--g);
    color: #fff;
}
.ia-panel-head h6 { margin: 0; font-size: .875rem; font-weight: 600; }
.ia-panel-head button {
    background: none; border: none;
    color: rgba(255,255,255,.72);
    cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.ia-panel-head button:hover { color: #fff; }

.ia-messages {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.ia-msg {
    max-width: 86%;
    padding: .5rem .75rem;
    border-radius: var(--r-sm);
    font-size: .82rem;
    line-height: 1.5;
}
.ia-msg.ia-msg-bot  { background: var(--g-xs); color: #14532d; align-self: flex-start; }
.ia-msg.ia-msg-user { background: #eff6ff; color: #1e3a5f; align-self: flex-end; }

.ia-input-row {
    display: flex;
    gap: .4rem;
    padding: .6rem .75rem;
    border-top: 1px solid var(--line-s);
    align-items: flex-end;
}
.ia-input-row textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: .4rem .6rem;
    font-size: .82rem;
    min-height: 38px;
    max-height: 100px;
    font-family: inherit;
    background: var(--bg);
    transition: border-color var(--t), background var(--t);
}
.ia-input-row textarea:focus {
    outline: none;
    border-color: var(--g);
    background: #fff;
}

.ia-btn-mic,
.ia-btn-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: background var(--t);
    flex-shrink: 0;
}
.ia-btn-mic  { background: var(--line-s); color: var(--ink-m); }
.ia-btn-mic:hover { background: var(--line); }
.ia-btn-mic.ia-mic-active { background: #dc2626; color: #fff; }
.ia-btn-send { background: var(--g); color: #fff; }
.ia-btn-send:hover { background: var(--g-d); }

.ia-typing {
    font-size: .78rem;
    color: var(--ink-s);
    padding: 0 1rem .4rem;
    min-height: 1.2rem;
}

@media (max-width: 440px) {
    .ia-panel { right: .5rem; left: .5rem; width: auto; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. RESPONSIVE GENERAL
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 767px) {
    .hero { padding: 7.5rem 0 4.5rem; min-height: 90vh; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.75rem; }
    .hero-stat-val { font-size: 1.4rem; }
    .pub-section, .pub-section-alt, .pub-section-dark { padding: 4rem 0; }
    .cta-section { padding: 5rem 0; }
    .section-title { font-size: 1.55rem; }
    .pub-nav-inner { padding: 0 1.25rem; }
    .pub-container { padding: 0 1.25rem; }
}

/* ── 8. UTILIDADES ──────────────────────────────────────── */
.text-body-secondary { color: var(--ink-s) !important; }
.text-muted          { color: var(--ink-xs) !important; }
small, .small        { color: inherit; }
.tracking            { letter-spacing: .1em; }
