* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================================
   CONTRASTE UNIFICADO DE CONTROLES DEL CRM
   Las declaraciones importantes neutralizan estilos inline
   heredados del tema oscuro presentes en páginas antiguas.
========================================================= */

main select,
.property-modal select {
    border-color: #d1d5db !important;
    background: #ffffff !important;
    color: #111827 !important;
}

main select option,
.property-modal select option {
    background: #ffffff;
    color: #111827;
}

html body main :is(
    .primary-button,
    .save-campaign,
    .execute-campaign,
    .save-template,
    .wa-primary,
    .save-contact,
    .save-structural-property,
    .save-reminder-button,
    .confirm-contact-button,
    .property-modal-save,
    .lead-data-save,
    .approve-lead,
    .mark-contacted
) {
    border-color: #4f46c8 !important;
    background: #5b5bd6 !important;
    color: #ffffff !important;
}

html body main :is(
    .primary-button,
    .save-campaign,
    .execute-campaign,
    .save-template,
    .wa-primary,
    .save-contact,
    .save-structural-property,
    .save-reminder-button,
    .confirm-contact-button,
    .property-modal-save,
    .lead-data-save,
    .approve-lead,
    .mark-contacted
):hover:not(:disabled) {
    border-color: #4338b5 !important;
    background: #4949b8 !important;
    color: #ffffff !important;
}

html body main :is(
    .whatsapp-button,
    .whatsapp-lead,
    .crm-whatsapp,
    .test-whatsapp,
    .conversation-whatsapp-button,
    .detail-whatsapp,
    .wa-green,
    .done-button,
    .new-reminder-button
) {
    border-color: #166534 !important;
    background: #15803d !important;
    color: #ffffff !important;
}

html body main :is(
    .whatsapp-button,
    .whatsapp-lead,
    .crm-whatsapp,
    .test-whatsapp,
    .conversation-whatsapp-button,
    .detail-whatsapp,
    .wa-green,
    .done-button,
    .new-reminder-button
):hover:not(:disabled):not(.disabled) {
    border-color: #14532d !important;
    background: #166534 !important;
    color: #ffffff !important;
}

html body main :is(
    .delete-contact,
    .delete-property,
    .delete-campaign,
    .delete-template,
    .delete-reminder-button,
    .wa-danger,
    .discard-lead,
    .remove
) {
    border-color: #991b1b !important;
    background: #b91c1c !important;
    color: #ffffff !important;
}

html body main .property-card :is(.whatsapp-button, .whatsapp-lead) {
    border-color: #166534 !important;
    background: #15803d !important;
    color: #ffffff !important;
}

html body main .property-card :is(.delete-property, .discard-lead) {
    border-color: #991b1b !important;
    background: #b91c1c !important;
    color: #ffffff !important;
}

html body main.contacts-page :is(
    .save-contact,
    .confirm-contact-button,
    .property-modal-save
) {
    border-color: #4f46c8 !important;
    background: #5b5bd6 !important;
    color: #ffffff !important;
}

html body main.contacts-page :is(
    .whatsapp-button,
    .crm-whatsapp,
    .detail-whatsapp
) {
    border-color: #166534 !important;
    background: #15803d !important;
    color: #ffffff !important;
}

html body main.contacts-page .delete-contact {
    border-color: #991b1b !important;
    background: #b91c1c !important;
    color: #ffffff !important;
}

html body main :is(
    .delete-contact,
    .delete-property,
    .delete-campaign,
    .delete-template,
    .delete-reminder-button,
    .wa-danger,
    .discard-lead,
    .remove
):hover:not(:disabled) {
    border-color: #7f1d1d !important;
    background: #991b1b !important;
    color: #ffffff !important;
}

.properties-page .clear-button {
    border-color: #991b1b !important;
    background: #b91c1c !important;
    color: #ffffff !important;
}

.properties-page .clear-button:hover:not(:disabled) {
    background: #991b1b !important;
    color: #ffffff !important;
}

html body main :is(
    .secondary-button,
    .wa-neutral,
    .campaign-toggle-details,
    .edit-campaign,
    .view-campaign-leads,
    .toggle-campaign,
    .template-toggle,
    .use-template,
    .edit-template,
    .variable-button,
    .cancel-edit,
    .cancel-contact-button,
    .property-modal-cancel,
    .cancel-structural-property,
    .edit-structural-property,
    .compact-property-toggle,
    .refresh-message,
    .open-conversation,
    .crm-property-link,
    .detail-back-to-contacts,
    .detail-property-link,
    .open-contact-button,
    .open-button,
    .notification-button,
    .cancel-reminder-button,
    .clear-button,
    .copy-preview,
    .copy-template
) {
    border-color: #d1d5db !important;
    background: #ffffff !important;
    color: #111827 !important;
}

html body main :is(
    .secondary-button,
    .wa-neutral,
    .campaign-toggle-details,
    .edit-campaign,
    .view-campaign-leads,
    .toggle-campaign,
    .template-toggle,
    .use-template,
    .edit-template,
    .variable-button,
    .cancel-edit,
    .cancel-contact-button,
    .property-modal-cancel,
    .cancel-structural-property,
    .edit-structural-property,
    .compact-property-toggle,
    .refresh-message,
    .open-conversation,
    .crm-property-link,
    .detail-back-to-contacts,
    .detail-property-link,
    .open-contact-button,
    .open-button,
    .notification-button,
    .cancel-reminder-button,
    .clear-button,
    .copy-preview,
    .copy-template
):hover:not(:disabled) {
    border-color: #9ca3af !important;
    background: #f3f4f6 !important;
    color: #111827 !important;
}

html body main :is(.call-button, .call-lead, .crm-call, .detail-call) {
    border-color: #93c5fd !important;
    background: #eff6ff !important;
    color: #1e3a8a !important;
}

html body main :is(.call-button, .call-lead, .crm-call, .detail-call):hover:not(:disabled) {
    border-color: #60a5fa !important;
    background: #dbeafe !important;
    color: #1e3a8a !important;
}

html body main .day-button {
    border-color: #d1d5db !important;
    background: #ffffff !important;
    color: #111827 !important;
}

html body main .day-button:hover:not(:disabled) {
    border-color: #a5b4fc !important;
    background: #eef2ff !important;
    color: #3730a3 !important;
}

html body main .day-button.active {
    border-color: #4f46c8 !important;
    background: #5b5bd6 !important;
    color: #ffffff !important;
}

html body main .default-template {
    border-color: #f59e0b !important;
    background: #fffbeb !important;
    color: #92400e !important;
}

button:disabled,
button[aria-disabled="true"],
a.disabled,
.disabled-link,
.whatsapp-button.disabled {
    opacity: .62 !important;
    cursor: not-allowed !important;
    filter: saturate(.72);
}

:root {
    /* Fondo general */
    --background: #f8fafc;
    --background-light: #ffffff;
    --card: #ffffff;

    /* Textos */
    --text: #1f2937;
    --text-muted: #6b7280;

    /* Color principal CRM */
    --primary: #5b5bd6;
    --primary-light: #eeeeff;

    /* Bordes */
    --border: #e5e7eb;

    /* Colores funcionales: usar solo cuando corresponda */
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}


html {
    scroll-behavior: smooth;
}

body {
   
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.6;
}


a {
    color: inherit;
    text-decoration: none;
}

.navbar {
    width: 100%;
    min-height: 68px;
    padding: 0 3%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 18, 37, 0.95);
}

.logo,
.footer-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.menu {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.menu a {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: 0.2s ease;
}

.menu a:hover {
    color: var(--text);
}

.login-button {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
}

.login-button:hover {
    background: rgba(255, 255, 255, 0.09);
}

.hero {
    min-height: 760px;
    padding: 110px 4% 90px;
    display: flex;
    align-items: center;
}

.hero-content {
    width: 100%;
    max-width: 1050px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(139, 105, 255, 0.7);
    border-radius: 999px;
    background: rgba(114, 87, 255, 0.12);
    color: #c5b8ff;
    font-size: 11px;
    font-weight: 600;
}

.hero h1 {
    max-width: 1000px;
    margin-bottom: 14px;
    font-size: clamp(52px, 6vw, 88px);
    line-height: 0.99;
    letter-spacing: -4px;
}

.hero-description {
    max-width: 920px;
    margin-bottom: 38px;
    color: #c2cbe0;
    font-size: 24px;
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 64px;
}

.primary-button,
.secondary-button {
    min-width: 0;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 800;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.primary-button {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-light)
    );
}

.secondary-button {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 80px;
}

.stat {
    min-width: 170px;
    display: flex;
    flex-direction: column;
}

.stat strong {
    font-size: 23px;
    line-height: 1;
}

.stat span {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 10px;
}

.features,
.process {
    padding: 100px 4%;
    border-top: 1px solid var(--border);
}

.features {
    background: rgba(255, 255, 255, 0.015);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 52px;
}

.section-heading > span {
    display: block;
    margin-bottom: 14px;
    color: #9986ff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.section-heading h2 {
    margin-bottom: 16px;
    font-size: clamp(36px, 4vw, 55px);
    line-height: 1.08;
    letter-spacing: -2px;
}

.section-heading p {
    color: var(--text-muted);
    font-size: 19px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.feature-card {
    min-height: 310px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.055),
        rgba(255, 255, 255, 0.018)
    );
}

.feature-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(114, 87, 255, 0.16);
    color: #b9abff;
    font-size: 24px;
}

.feature-card h3 {
    margin-bottom: 13px;
    font-size: 23px;
}

.feature-card p {
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 10px;
}

.feature-card a {
    color: #a997ff;
    font-weight: 700;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.process-step {
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.process-step strong {
    display: block;
    margin-bottom: 18px;
    color: #8e79ff;
    font-size: 11px;
}

.process-step h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.process-step p {
    color: var(--text-muted);
}

.footer {
    min-height: 180px;
    padding: 45px 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.footer-logo {
    color: var(--text);
}

@media (max-width: 1050px) {
    .feature-grid,
    .process-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero h1 {
        letter-spacing: -3px;
    }
}

@media (max-width: 760px) {
    .navbar {
        padding: 22px 5%;
    }

    .menu {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .logo {
        font-size: 25px;
    }

    .login-button {
        padding: 10px 15px;
    }

    .hero {
        min-height: auto;
        padding: 75px 5%;
    }

    .hero h1 {
        font-size: 48px;
        letter-spacing: -2px;
    }

    .hero-description {
        font-size: 19px;
        line-height: 1.55;
    }

    .stats {
        gap: 35px;
    }

    .feature-grid,
    .process-grid {
        grid-template-columns: 1fr;
    }

    .features,
    .process {
        padding: 75px 5%;
    }

    .footer {
        padding: 40px 5%;
        flex-direction: column;
        align-items: flex-start;
    }
}
/* =========================
   PÁGINA EXTRAER ANUNCIO
========================= */

.extract-page {
    padding: 42px 4% 75px;
}

.extract-header {
    max-width: 900px;
    margin-bottom: 22px;
}

.extract-header h1 {
    margin-bottom: 20px;
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.05;
    letter-spacing: -3px;
}

.extract-header p {
    max-width: 850px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.7;
}

.extract-panel {
    max-width: 1100px;
    margin-bottom: 20px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
}

.extract-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 10px;
    font-weight: 800;
}

.extract-input-row {
    display: flex;
    gap: 8px;
}

.extract-input-row input {
    flex: 1;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
    font-size: 11px;
}

.extract-input-row input::placeholder {
    color: #71809d;
}

.extract-input-row input:focus {
    border-color: #816cff;
    box-shadow: 0 0 0 3px rgba(129, 108, 255, 0.15);
}

.extract-input-row .primary-button {
    border: none;
    cursor: pointer;
}

.form-help {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.result-section {
    max-width: 1250px;
}

.result-heading {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.result-heading span {
    display: block;
    margin-bottom: 8px;
    color: #9986ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.result-heading h2 {
    font-size: 23px;
    line-height: 1.1;
}

.seller-badge {
    padding: 10px 17px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
}

.seller-badge.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.seller-badge.particular {
    border-color: rgba(39, 199, 116, 0.45);
    background: rgba(39, 199, 116, 0.12);
    color: #70e3a8;
}

.seller-badge.agency {
    border-color: rgba(255, 94, 94, 0.45);
    background: rgba(255, 94, 94, 0.12);
    color: #ff9696;
}

.result-layout {
    display: grid;
    grid-template-columns: 0.85fr 1.35fr;
    gap: 8px;
}

.property-preview,
.result-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.property-image-wrapper {
    position: relative;
    min-height: 100%;
    aspect-ratio: 4 / 3;
    background: #0c1529;
}

.property-image {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: cover;
}

.image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 10px;
}

.result-card {
    padding: 17px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.result-item {
    min-height: 66px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.result-item:nth-child(odd) {
    border-right: 1px solid var(--border);
}

.result-item span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.result-item strong {
    display: block;
    color: var(--text);
    font-size: 10px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.result-actions {
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-actions button {
    border: none;
    cursor: pointer;
}

.result-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.disabled-link {
    pointer-events: none;
    opacity: 0.45;
}

@media (max-width: 900px) {
    .result-layout {
        grid-template-columns: 1fr;
    }

    .property-image-wrapper {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 680px) {
    .extract-page {
        padding: 60px 5% 80px;
    }

    .extract-header h1 {
        font-size: 44px;
        letter-spacing: -2px;
    }

    .extract-input-row {
        flex-direction: column;
    }

    .extract-input-row .primary-button {
        width: 100%;
    }

    .result-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-item:nth-child(odd) {
        border-right: none;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions a,
    .result-actions button {
        width: 100%;
    }
}

/* Ajustes globales compactos */
button,
input,
select,
textarea {
    font: inherit;
}

.whatsapp-button,
.whatsapp-lead,
.crm-whatsapp,
.test-whatsapp {
    border-color: rgba(37, 211, 102, .55) !important;
    background: rgba(37, 211, 102, .13) !important;
    color: #25d366 !important;
}

.call-button,
.call-lead,
.crm-call,
.delete-contact,
.delete-property,
.delete-campaign,
.delete-template {
    border-color: rgba(255, 107, 107, .42) !important;
    background: rgba(255, 107, 107, .09) !important;
    color: #ff9c9c !important;
}

@media (max-width: 1180px) {
    .navbar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .login-button {
        display: none;
    }

    .menu {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .navbar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 5%;
    }

    .menu a {
        font-size: 12px;
        white-space: nowrap;
    }
}

/* =========================================================
   BARRA LATERAL CRM · VERSIÓN CONSOLIDADA
========================================================= */

:root {
    --sidebar-width: 76px;
    --sidebar-bg: #0d1930;
    --sidebar-hover: rgba(255,255,255,.07);
    --sidebar-active: rgba(114,87,255,.22);
}

body {
    padding-left: var(--sidebar-width);
}

main,
.footer {
    width: 100%;
    min-width: 0;
}

/* Contenedor lateral */
.navbar,
.navbar:hover {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    width: var(--sidebar-width);
    min-height: 100vh;
    height: 100vh;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    background: var(--sidebar-bg);
    box-shadow: none;
    overflow: visible;
}

/* Logotipo */
.logo,
.navbar:hover .logo {
    width: 100%;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: transparent;
    font-size: 0;
}

.logo::before,
.navbar:hover .logo::before {
    content: "D";
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg,var(--primary),var(--primary-light));
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.navbar:hover .logo::after {
    content: none;
}

/* Menú */
.menu,
.navbar:hover .menu {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px;
    overflow: visible;
}

.menu a,
.navbar:hover .menu a,
.login-button,
.navbar:hover .login-button {
    position: relative;
    width: 100%;
    min-height: 46px;
    padding: 0;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0;
    font-weight: 700;
    white-space: nowrap;
    transition: background .18s ease,color .18s ease,border-color .18s ease;
}

.menu a:hover,
.navbar:hover .menu a:hover,
.login-button:hover,
.navbar:hover .login-button:hover {
    border-color: rgba(255,255,255,.08);
    background: var(--sidebar-hover);
    color: #fff;
}

/* Iconos vectoriales: evita símbolos repetidos o inconsistentes */
.menu a::before,
.login-button::before {
    content: "";
    width: 22px;
    height: 22px;
    display: block;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.menu a[href="index.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 11.5 12 4l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 11.5 12 4l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E");
}

.menu a[href="campanas.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3zm2 2v10h14V7zm2 2h10v2H7zm0 4h6v2H7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3zm2 2v10h14V7zm2 2h10v2H7zm0 4h6v2H7z'/%3E%3C/svg%3E");
}

.menu a[href="propiedades.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h16v18H4zm3 3v4h4V6zm6 0v4h4V6zM7 12v6h4v-6zm6 0v6h4v-6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h16v18H4zm3 3v4h4V6zm6 0v4h4V6zM7 12v6h4v-6zm6 0v6h4v-6z'/%3E%3C/svg%3E");
}

.menu a[href="contactos.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-7 8a7 7 0 0 1 14 0z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-7 8a7 7 0 0 1 14 0z'/%3E%3C/svg%3E");
}

.menu a[href="embudo.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18l-7 8v6l-4 2v-8z'/%3E%3C/svg%3E");
}

.menu a[href="recordatorios.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a8 8 0 0 1 8 8v5l2 2v1H2v-1l2-2v-5a8 8 0 0 1 8-8m-3 18h6a3 3 0 0 1-6 0'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a8 8 0 0 1 8 8v5l2 2v1H2v-1l2-2v-5a8 8 0 0 1 8-8m-3 18h6a3 3 0 0 1-6 0'/%3E%3C/svg%3E");
}

.menu a[href="plantillas.html"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3zm2 2v1l7 5 7-5V7zm14 4-7 5-7-5v6h14z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h18v14H3zm2 2v1l7 5 7-5V7zm14 4-7 5-7-5v6h14z'/%3E%3C/svg%3E");
}

.login-button::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
}

/* Orden fijo */
.login-button { order: -1; }
.menu a[href="index.html"] { order: 1; }
.menu a[href="campanas.html"] { order: 2; }
.menu a[href="propiedades.html"] { order: 3; }
.menu a[href="contactos.html"] { order: 4; }
.menu a[href="embudo.html"] { order: 5; }
.menu a[href="recordatorios.html"] { order: 6; }
.menu a[href="plantillas.html"] { order: 7; }

/* Evitar duplicar Extraer anuncio si aparece dentro del nav */
.menu a[href="extraer.html"] {
    display: none !important;
}

/* Botón superior */
.login-button,
.navbar:hover .login-button {
    display: flex;
    border-color: rgba(114,87,255,.38);
    background: rgba(114,87,255,.13);
    color: #cbbfff;
}

/* Estado activo */
.menu a.active,
.menu a[aria-current="page"],
.login-button.active,
.login-button[aria-current="page"] {
    border-color: rgba(114,87,255,.5);
    background: var(--sidebar-active);
    color: #d8d0ff;
}

/* Tooltips */
.menu a::after,
.login-button::after {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    z-index: 1001;
    padding: 7px 10px;
    transform: translateY(-50%) translateX(-4px);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111d34;
    color: #fff;
    box-shadow: 0 10px 28px rgba(0,0,0,.25);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease,transform .15s ease;
}

.menu a:hover::after,
.login-button:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.menu a[href="index.html"]::after { content: "Inicio"; }
.menu a[href="campanas.html"]::after { content: "Campañas"; }
.menu a[href="propiedades.html"]::after { content: "Propiedades"; }
.menu a[href="contactos.html"]::after { content: "Contactos"; }
.menu a[href="embudo.html"]::after { content: "Embudo"; }
.menu a[href="recordatorios.html"]::after { content: "Recordatorios"; }
.menu a[href="plantillas.html"]::after { content: "Plantillas"; }
.login-button::after { content: "Extraer anuncio"; }

/* Móvil */
@media (max-width: 760px) {
    :root {
        --sidebar-width: 0px;
    }

    body {
        padding-left: 0;
        padding-top: 66px;
    }

    .navbar,
    .navbar:hover {
        inset: 0 0 auto 0;
        width: 100%;
        min-height: 66px;
        height: 66px;
        padding: 8px 12px;
        display: grid;
        grid-template-columns: 44px minmax(0,1fr) 44px;
        align-items: center;
        gap: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        overflow: hidden;
    }

    .logo,
    .navbar:hover .logo {
        width: 44px;
        height: 44px;
    }

    .logo::before,
    .navbar:hover .logo::before {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .menu,
    .navbar:hover .menu {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
    }

    .menu a,
    .navbar:hover .menu a,
    .login-button,
    .navbar:hover .login-button {
        flex: 0 0 42px;
        width: 42px;
        min-height: 42px;
    }

    .menu a::after,
    .login-button::after {
        display: none;
    }
}
