/* KS Manager v0.1.0 | Autor: Codilogic */
:root{--bg:#f4f1eb;--card:#fff;--ink:#171717;--muted:#727272;--line:#ddd7cc;--gold:#b99a55;--gold-dark:#95783d;--dark:#171717;--danger:#a13a32;--success:#3e6e54}*{box-sizing:border-box}html,body{margin:0;min-height:100%}body{background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:14px}a{color:inherit}.topbar{position:sticky;top:0;z-index:100;display:grid;grid-template-columns:260px 1fr auto;align-items:center;gap:30px;min-height:76px;padding:0 30px;background:var(--dark);border-bottom:1px solid rgba(185,154,85,.35);color:#fff}.brand{display:inline-flex;align-items:center;gap:12px;color:#fff;text-decoration:none}.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid var(--gold);color:var(--gold);font-weight:700;font-size:12px;letter-spacing:.08em}.brand-mark.large{width:54px;height:54px;flex:0 0 auto}.brand strong,.brand small{display:block}.brand small{margin-top:2px;color:rgba(255,255,255,.5);font-size:10px;text-transform:uppercase;letter-spacing:.12em}.topbar nav{display:flex;justify-content:center;gap:24px}.topbar nav a{color:rgba(255,255,255,.72);text-decoration:none;font-size:13px}.topbar nav a:hover,.topbar nav .nav-primary{color:var(--gold)}.user-menu{display:flex;align-items:center;gap:14px;color:rgba(255,255,255,.62);font-size:12px}.user-menu form{margin:0}.link-button{border:0;padding:0;background:transparent;color:var(--gold);cursor:pointer}.main{width:calc(100% - 60px);max-width:1500px;margin:0 auto;padding:46px 0 70px}.guest-main{min-height:calc(100vh - 45px);display:flex;align-items:center;justify-content:center;padding:35px 20px}.app-footer{padding:15px 30px 25px;color:#8b8b8b;font-size:11px;text-align:center}.auth-card{width:100%;max-width:470px;padding:42px;background:#fff;border:1px solid var(--line)}.auth-brand{display:flex;align-items:center;gap:18px;margin-bottom:32px}.auth-brand h1{margin:0;font-size:28px;font-weight:500}.auth-brand p{margin:5px 0 0;color:var(--muted)}.form-stack{display:grid;gap:18px}label{color:#3b3b3b;font-size:12px;font-weight:600}input[type=text],input[type=email],input[type=password],input[type=number],select,textarea{display:block;width:100%;margin-top:8px;padding:13px 14px;background:#faf9f6;border:1px solid var(--line);border-radius:0;color:var(--ink);font:inherit;font-weight:400;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--gold)}textarea{resize:vertical}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:11px 18px;border:1px solid transparent;text-decoration:none;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.btn-primary{background:var(--dark);color:#fff}.btn-primary:hover{background:var(--gold);color:#111}.btn-secondary{border-color:var(--line);background:#fff;color:#222}.flash{margin-bottom:22px;padding:13px 16px;border-left:3px solid;background:#fff}.flash-success{border-color:var(--success)}.flash-error{border-color:var(--danger)}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:30px;margin-bottom:38px}.eyebrow{display:block;margin-bottom:8px;color:var(--gold-dark);font-size:10px;font-weight:700;letter-spacing:.14em}.page-heading h1{margin:0;font-size:clamp(34px,4vw,52px);font-weight:400;letter-spacing:-1.5px}.page-heading p{margin:10px 0 0;color:var(--muted);line-height:1.7}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-bottom:28px}.stat-card{min-height:170px;padding:26px;background:#fff;border:1px solid var(--line)}.stat-card span{display:block;color:var(--gold-dark);font-size:10px;font-weight:700;letter-spacing:.12em}.stat-card strong{display:block;margin:20px 0 8px;font-size:46px;font-weight:400}.stat-card small{color:var(--muted)}.panel-card,.form-card,.empty-state{background:#fff;border:1px solid var(--line)}.panel-card{padding:34px}.panel-card-head{display:flex;align-items:flex-end;justify-content:space-between;gap:30px}.panel-card h2{margin:0;font-size:27px;font-weight:500}.panel-card p{max-width:760px;color:var(--muted);line-height:1.8}.panel-card-head a{color:var(--gold-dark);text-decoration:none}.empty-state{padding:70px 30px;text-align:center}.empty-state h2{margin:0 0 10px;font-size:28px;font-weight:500}.empty-state p{margin:0 0 26px;color:var(--muted)}.property-list{display:grid;gap:12px}.property-row{display:grid;grid-template-columns:150px minmax(260px,1fr) auto 150px;align-items:center;gap:24px;padding:16px;background:#fff;border:1px solid var(--line)}.property-thumb{display:flex;align-items:center;justify-content:center;width:150px;height:92px;overflow:hidden;background:#ece8df;color:#8a8a8a;font-size:11px}.property-thumb img{width:100%;height:100%;object-fit:cover}.property-ref{margin-bottom:5px;color:var(--gold-dark);font-size:10px;font-weight:700;letter-spacing:.1em}.property-main h2{margin:0 0 6px;font-size:20px;font-weight:500}.property-main p{margin:0;color:var(--muted)}.property-badges{display:flex;flex-wrap:wrap;gap:6px}.badge{display:inline-block;padding:7px 9px;background:#171717;color:#fff;font-size:9px;text-transform:uppercase;letter-spacing:.06em}.badge-light{background:#ece8df;color:#333}.property-sync strong,.property-sync small{display:block}.property-sync strong{font-size:12px}.property-sync small{margin-top:4px;color:var(--muted);font-size:10px}.property-form{display:grid;gap:22px}.form-card{padding:34px}.form-card-title{display:flex;gap:16px;margin-bottom:30px}.form-card-title>span{color:var(--gold-dark);font-size:11px;font-weight:700}.form-card-title h2{margin:0;font-size:25px;font-weight:500}.form-card-title p{margin:6px 0 0;color:var(--muted)}.form-grid{display:grid;gap:20px}.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.full-field{display:block;margin-top:20px}.check-grid{display:flex;flex-wrap:wrap;gap:24px;margin-top:24px}.check{display:inline-flex;align-items:center;gap:8px;font-weight:500}.featured-upload{display:grid;grid-template-columns:1fr auto;align-items:center;gap:30px;padding:30px;background:#f5f1e8;border:1px solid #d8cdae}.upload-kicker{color:var(--gold-dark);font-size:10px;font-weight:700;letter-spacing:.14em}.featured-upload h3,.gallery-upload h3{margin:8px 0;font-size:22px;font-weight:500}.featured-upload p,.gallery-upload p{margin:0 0 8px;color:var(--muted);line-height:1.7}.featured-upload small{color:#8b7a52}.upload-control{display:block;min-width:220px;padding:18px;background:#fff;border:1px solid var(--line)}.upload-control input{display:block;width:100%;margin-top:12px}.gallery-upload{margin-top:20px;padding:30px;border:1px dashed #cfc6b5}.gallery-upload input{margin-top:12px}.publish-box{display:flex;align-items:flex-start;gap:12px;margin-top:25px;padding:20px;background:#191919;color:#fff}.publish-box span,.publish-box strong,.publish-box small{display:block}.publish-box small{margin-top:5px;color:rgba(255,255,255,.55);line-height:1.5}.form-actions{display:flex;justify-content:flex-end;gap:10px}@media(max-width:1000px){.topbar{grid-template-columns:1fr auto}.topbar nav{display:none}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.property-row{grid-template-columns:120px 1fr}.property-thumb{width:120px}.property-badges,.property-sync{grid-column:2}.form-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.main{width:calc(100% - 30px);padding-top:30px}.topbar{padding:0 16px}.user-menu>span{display:none}.page-heading{display:block}.page-heading .btn{margin-top:20px}.stats-grid,.form-grid.two,.form-grid.three,.form-grid.four{grid-template-columns:1fr}.property-row{grid-template-columns:1fr}.property-thumb{width:100%;height:190px}.property-badges,.property-sync{grid-column:auto}.form-card{padding:24px 20px}.featured-upload{grid-template-columns:1fr}.form-actions{flex-direction:column-reverse}.form-actions .btn{width:100%}.auth-card{padding:28px 22px}}


/* =========================================================
   KS MANAGER v0.2.0 - REFINAMIENTO DE FORMULARIOS
   Autor: Codilogic
   ========================================================= */

.property-main h2 a {
    color: inherit;
    text-decoration: none;
}

.property-main h2 a:hover,
.edit-link:hover {
    color: var(--gold-dark);
}

.edit-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--gold-dark);
    font-size: 11px;
    text-decoration: none;
}

.badge-gold {
    background: var(--gold);
    color: #111;
}

.property-form {
    max-width: 1450px;
    margin: 0 auto;
}

.form-card {
    padding: 38px 42px;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.form-card-title {
    align-items: flex-start;
    padding-bottom: 22px;
    border-bottom: 1px solid #ece7dd;
}

.form-card-title > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid #d9ca9f;
    background: #fbf8f0;
}

.form-card-title h2 {
    font-size: 27px;
    letter-spacing: -.4px;
}

.form-card-title p {
    max-width: 700px;
    line-height: 1.6;
}

.form-grid {
    align-items: end;
}

.form-grid label,
.full-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #272727;
    font-size: 12px;
    font-weight: 700;
}

.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="number"],
.form-grid select,
.full-field textarea {
    margin-top: 0;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d8d1c4;
    background: #fbfaf7;
}

.form-grid input:focus,
.form-grid select:focus,
.full-field textarea:focus {
    background: #fff;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(185,154,85,.08);
}

.full-field {
    margin-top: 24px;
}

.full-field textarea {
    min-height: 150px;
}

.subsection-title {
    margin: 32px 0 18px;
    padding-top: 25px;
    border-top: 1px solid #ece7dd;
}

.subsection-title span {
    display: block;
    margin-bottom: 6px;
    color: var(--gold-dark);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
}

.subsection-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.previous-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 20px;
    padding: 15px 18px;
    background: #f5f1e8;
    border-left: 3px solid var(--gold);
    color: #5d5546;
    font-size: 12px;
}

.previous-prices strong {
    width: 100%;
    color: #1b1b1b;
}

.check-grid {
    padding-top: 20px;
    border-top: 1px solid #ece7dd;
}

.check {
    padding: 10px 14px;
    background: #f8f6f1;
    border: 1px solid #e5dfd2;
}

.current-images {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.current-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #eee;
}

.current-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.current-image span {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 6px 8px;
    background: rgba(20,20,20,.85);
    color: #fff;
    font-size: 9px;
}

.current-image.is-featured {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.sticky-actions {
    position: sticky;
    bottom: 12px;
    z-index: 40;
    padding: 14px;
    background: rgba(244,241,235,.95);
    backdrop-filter: blur(5px);
    border: 1px solid var(--line);
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-top: 34px;
    padding: 24px;
    border: 1px solid #e2c7c3;
    background: #fff7f6;
}

.danger-zone strong {
    color: #7e2d27;
}

.danger-zone p {
    margin: 5px 0 0;
    color: #8a6c69;
    font-size: 12px;
}

.btn-danger {
    background: #8c332c;
    color: #fff;
}

.btn-danger:hover {
    background: #6f241f;
}

@media (max-width: 1100px) {
    .current-images {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (max-width: 650px) {
    .form-card {
        padding: 24px 18px;
    }

    .form-card-title h2 {
        font-size: 23px;
    }

    .current-images {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .danger-zone .btn {
        width: 100%;
    }
}


/* =========================================================
   KS MANAGER v0.3.0
   Características, cálculos e imágenes
   Autor: Codilogic
   ========================================================= */

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

.feature-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    background: #faf9f6;
    border: 1px solid #e2dcd0;
    cursor: pointer;
    font-weight: 500;
}

.feature-option:hover {
    border-color: #c5aa68;
}

.feature-option:has(input:checked) {
    background: #f5efdf;
    border-color: #b99a55;
}

.feature-option input {
    accent-color: #b99a55;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 18px;
    background: #ddd7cc;
    border: 1px solid #ddd7cc;
    transition: opacity .2s ease;
}

.financial-summary > div {
    min-height: 94px;
    padding: 18px;
    background: #f8f6f1;
}

.financial-summary span,
.financial-summary strong {
    display: block;
}

.financial-summary span {
    margin-bottom: 10px;
    color: #777;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.financial-summary strong {
    color: #171717;
    font-size: 22px;
    font-weight: 500;
}

.financial-summary.is-muted {
    opacity: .42;
}

.calc-card {
    min-height: 75px;
    padding: 12px 14px;
    background: #f7f3e9;
    border: 1px solid #d9ca9f;
}

.calc-card span,
.calc-card strong {
    display: block;
}

.calc-card span {
    color: #76653f;
    font-size: 10px;
    text-transform: uppercase;
}

.calc-card strong {
    margin-top: 8px;
    font-size: 18px;
}

.current-image {
    overflow: visible;
    aspect-ratio: auto;
    background: #fff;
}

.current-image img {
    aspect-ratio: 4 / 3;
    display: block;
}

.current-image .image-label {
    padding: 9px 10px;
    background: #171717;
    color: #fff;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.current-image.is-featured .image-label {
    background: #b99a55;
    color: #111;
    font-weight: 700;
}

.image-actions {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0dace;
    border-top: 0;
}

.image-actions form {
    margin: 0;
}

.image-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    height: 31px;
    padding: 0 8px;
    border: 1px solid #ddd7cc;
    background: #faf9f6;
    color: #222;
    cursor: pointer;
}

.image-actions button:hover {
    background: #191919;
    border-color: #191919;
    color: #fff;
}

.image-actions .image-delete {
    color: #8c332c;
}

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

@media (max-width: 700px) {
    .feature-grid,
    .financial-summary {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        gap: 7px;
    }
}


/* =========================================================
   KS MANAGER v0.4.0
   Notificaciones y sincronización WordPress
   Autor: Codilogic
   ========================================================= */

.btn-gold {
    background: #b99a55;
    border-color: #b99a55;
    color: #111;
}

.btn-gold:hover {
    background: #a78949;
    border-color: #a78949;
    color: #111;
}

.toast-stack {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    width: min(430px, calc(100vw - 32px));
}

.toast {
    display: grid;
    grid-template-columns: 12px minmax(0,1fr) 28px;
    align-items: start;
    gap: 12px;
    padding: 17px 16px;
    background: #fff;
    border: 1px solid #ddd7cc;
    box-shadow: 0 14px 35px rgba(0,0,0,.14);
    transition: opacity .25s ease, transform .25s ease;
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.toast-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: #3e6e54;
}

.toast-publish .toast-dot {
    background: #b99a55;
}

.toast-warning .toast-dot {
    background: #ca8529;
}

.toast-error .toast-dot {
    background: #a13a32;
}

.toast-content strong,
.toast-content span {
    display: block;
}

.toast-content strong {
    margin-bottom: 4px;
    color: #171717;
    font-size: 13px;
}

.toast-content span {
    color: #666;
    font-size: 12px;
    line-height: 1.55;
}

.toast-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.web-sync-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
    margin: -10px 0 26px;
    padding: 23px 26px;
    background: #fff;
    border: 1px solid #ddd7cc;
    border-left: 4px solid #aaa;
}

.web-sync-synced {
    border-left-color: #3e6e54;
}

.web-sync-pending {
    border-left-color: #b99a55;
}

.web-sync-error {
    border-left-color: #a13a32;
}

.web-sync-not_published {
    border-left-color: #999;
}

.web-sync-card h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.web-sync-card p {
    margin: 6px 0 0;
    color: #777;
    font-size: 12px;
}

.sync-error-text {
    color: #8b302a !important;
}

.web-sync-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.web-sync-actions form {
    margin: 0;
}

@media (max-width: 700px) {
    .toast-stack {
        top: 82px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .web-sync-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .web-sync-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .web-sync-actions .btn {
        width: 100%;
    }

    .web-sync-actions form {
        width: 100%;
    }
}


/* =========================================================
   KS MANAGER v0.4.1
   Diagnóstico WordPress
   Autor: Codilogic
   ========================================================= */

.wp-diagnostic-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
    padding: 28px 30px;
    background: #fff;
    border: 1px solid #ddd7cc;
    border-left: 4px solid #a13a32;
}

.wp-diagnostic-summary.is-ok {
    border-left-color: #3e6e54;
}

.wp-diagnostic-summary h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 500;
}

.wp-diagnostic-summary p {
    margin: 8px 0 0;
    color: #707070;
}

.wp-diagnostic-badge {
    padding: 9px 13px;
    background: #171717;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.wp-diagnostic-summary.is-ok .wp-diagnostic-badge {
    background: #3e6e54;
}

.wp-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.wp-check-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    min-height: 145px;
    padding: 24px;
    background: #fff;
    border: 1px solid #ddd7cc;
}

.wp-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #a13a32;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.wp-check-card.is-ok .wp-check-icon {
    background: #3e6e54;
}

.wp-check-card span,
.wp-check-card strong,
.wp-check-card small {
    display: block;
}

.wp-check-card span {
    margin-bottom: 7px;
    color: #8a7650;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.wp-check-card strong {
    color: #171717;
    font-size: 18px;
    font-weight: 500;
}

.wp-check-card small {
    margin-top: 9px;
    color: #777;
    font-size: 11px;
    line-height: 1.55;
}

.wp-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 25px;
    background: #ddd7cc;
    border: 1px solid #ddd7cc;
}

.wp-config-grid > div {
    padding: 20px;
    background: #faf9f6;
}

.wp-config-grid span,
.wp-config-grid strong,
.wp-config-grid small {
    display: block;
}

.wp-config-grid span {
    margin-bottom: 7px;
    color: #777;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.wp-config-grid strong {
    word-break: break-word;
    font-size: 14px;
}

.wp-config-grid small {
    margin-top: 7px;
    color: #777;
    line-height: 1.5;
}

.wp-security-note {
    margin: 22px 0 0 !important;
    padding: 13px 15px;
    background: #f6f2e8;
    border-left: 3px solid #b99a55;
    color: #685f4c !important;
    font-size: 12px !important;
}

.wp-security-note code {
    color: #171717;
}

@media (max-width: 950px) {
    .wp-check-grid,
    .wp-config-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .wp-diagnostic-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .wp-check-grid,
    .wp-config-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   KS MANAGER v0.5.0
   Clientes, matching y seguimiento comercial
   Autor: Codilogic
   ========================================================= */

.heading-actions {
    display: flex;
    gap: 10px;
}

.stats-grid-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.client-search {
    display: flex;
    gap: 9px;
    margin-bottom: 20px;
}

.client-search input {
    flex: 1;
    margin: 0;
    min-height: 44px;
}

.client-list {
    display: grid;
    gap: 11px;
}

.client-row {
    display: grid;
    grid-template-columns: 52px minmax(260px, 1fr) 240px auto;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line);
}

.client-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #171717;
    color: #b99a55;
    font-size: 17px;
    font-weight: 700;
}

.client-origin {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-dark);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.client-main h2 {
    margin: 0 0 5px;
    font-size: 19px;
    font-weight: 500;
}

.client-main h2 a {
    color: inherit;
    text-decoration: none;
}

.client-main h2 a:hover {
    color: var(--gold-dark);
}

.client-main p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.client-meta {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.client-meta small {
    color: #777;
}

.client-section {
    margin-top: 28px;
    padding: 34px;
    background: #fff;
    border: 1px solid var(--line);
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 26px;
}

.section-heading-row h2 {
    margin: 0;
    font-size: 27px;
    font-weight: 500;
}

.section-heading-row p {
    margin: 7px 0 0;
    color: var(--muted);
}

.match-count {
    padding: 8px 10px;
    background: #f5efdf;
    color: #80672f;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.empty-inline {
    padding: 24px;
    background: #faf9f6;
    border: 1px dashed #d8d1c4;
    color: #777;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.match-card {
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}

.match-card-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ece8df;
    color: #888;
    font-size: 11px;
}

.match-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-card-image > strong {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 7px 9px;
    background: #3e6e54;
    color: #fff;
    font-size: 10px;
}

.match-card-body {
    padding: 18px;
}

.match-card h3 {
    margin: 4px 0 6px;
    font-size: 19px;
    font-weight: 500;
}

.match-card p {
    margin: 0;
    color: #777;
    font-size: 12px;
}

.match-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 13px;
}

.match-reasons span {
    padding: 5px 7px;
    background: #f6f3ec;
    color: #75643e;
    font-size: 9px;
    text-transform: uppercase;
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.match-footer > strong {
    font-size: 18px;
    font-weight: 500;
}

.match-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.match-actions form {
    margin: 0;
}

.history-list {
    display: grid;
    gap: 9px;
}

.history-row {
    display: grid;
    grid-template-columns: minmax(240px, .75fr) minmax(450px, 1.25fr);
    align-items: center;
    gap: 25px;
    padding: 17px 18px;
    background: #faf9f6;
    border: 1px solid #e3ddd1;
}

.history-row h3 {
    margin: 4px 0;
    font-size: 16px;
    font-weight: 500;
}

.history-row h3 a {
    color: inherit;
    text-decoration: none;
}

.history-row small {
    color: #777;
}

.history-form {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 8px;
    align-items: center;
}

.history-form select,
.history-form input {
    margin: 0;
    min-height: 40px;
}

.compatible-client-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.compatible-client-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 180px;
    padding: 20px;
    background: #faf9f6;
    border: 1px solid #e3ddd1;
}

.compatible-client-card h3 {
    margin: 8px 0 6px;
    font-size: 18px;
    font-weight: 500;
}

.compatible-client-card h3 a {
    color: inherit;
    text-decoration: none;
}

.compatible-client-card p {
    margin: 0;
    color: #777;
    font-size: 12px;
}

.compatible-client-card form {
    margin: 0;
}

.match-score {
    color: #3e6e54;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

@media (max-width: 1200px) {
    .stats-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-row {
        grid-template-columns: 52px 1fr auto;
    }

    .client-meta {
        grid-column: 2;
    }

    .client-actions {
        grid-row: 1 / span 2;
        grid-column: 3;
    }

    .match-grid,
    .compatible-client-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 850px) {
    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    .history-row {
        grid-template-columns: 1fr;
    }

    .history-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .heading-actions,
    .client-search,
    .section-heading-row {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid-six,
    .match-grid,
    .compatible-client-grid {
        grid-template-columns: 1fr;
    }

    .client-row {
        grid-template-columns: 48px 1fr;
    }

    .client-meta,
    .client-actions {
        grid-column: 2;
        grid-row: auto;
    }

    .client-actions .btn {
        width: 100%;
    }

    .match-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .match-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .match-actions .btn {
        width: 100%;
    }

    .client-section {
        padding: 24px 18px;
    }
}


/* KS Manager v0.5.1 - filtros ampliados de clientes */

.subsection-help {
    margin: 8px 0 0;
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}

.client-feature-grid {
    margin-top: 6px;
}

.client-feature-grid .feature-option {
    min-height: 54px;
}

.client-feature-grid .feature-option:has(input:checked) {
    background: #f2ead6;
    border-color: #b99a55;
    box-shadow: inset 0 0 0 1px #b99a55;
}


/* =========================================================
   KS MANAGER v0.5.2
   Ubicaciones múltiples
   Autor: Codilogic
   ========================================================= */

.location-preference-box {
    padding: 18px;
    background: #faf9f6;
    border: 1px solid #e3ddd1;
}

.location-pref-head,
.location-pref-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.35fr 38px;
    gap: 8px;
    align-items: center;
}

.location-pref-head {
    padding: 0 4px 8px;
    color: #80745d;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.location-pref-rows {
    display: grid;
    gap: 8px;
}

.location-pref-row {
    padding: 9px;
    background: #fff;
    border: 1px solid #e4ded2;
}

.location-pref-row input[type="text"] {
    min-height: 42px;
    margin: 0;
}

.location-pref-row input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.location-scope-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 8px;
}

.location-scope-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #555;
    font-size: 11px;
    font-weight: 500;
}

.location-scope-options input {
    accent-color: #b99a55;
}

.location-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e0d5ce;
    background: #fff;
    color: #8c332c;
    font-size: 20px;
    cursor: pointer;
}

.location-remove:hover {
    background: #8c332c;
    color: #fff;
}

.location-add {
    margin-top: 12px;
}

@media (max-width: 1000px) {
    .location-pref-head {
        display: none;
    }

    .location-pref-row {
        grid-template-columns: 1fr 1fr;
    }

    .location-scope-options {
        grid-column: 1 / -1;
    }

    .location-remove {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 650px) {
    .location-pref-row {
        grid-template-columns: 1fr;
    }

    .location-remove,
    .location-scope-options {
        grid-column: 1;
    }
}


/* KS Manager v0.5.4 - catálogo y selectores de ubicación */

.field-help {
    display: block;
    margin-top: 6px;
    color: #777;
    font-size: 10px;
    font-weight: 400;
}

.field-help a,
.location-manage-link {
    color: #8b6c2f;
    text-decoration: none;
}

.field-help a:hover,
.location-manage-link:hover {
    text-decoration: underline;
}

.location-pref-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 12px;
}

.location-manage-link {
    font-size: 11px;
}

.location-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.location-admin-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.location-admin-form input,
.location-admin-form select {
    width: 100%;
}

.location-catalog-list {
    margin-top: 20px;
}

.location-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 1px;
    margin-top: 22px;
    background: #ddd7cc;
    border: 1px solid #ddd7cc;
}

.location-summary-grid > div {
    padding: 20px;
    background: #faf9f6;
}

.location-summary-grid span,
.location-summary-grid strong {
    display: block;
}

.location-summary-grid span {
    color: #777;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.location-summary-grid strong {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 500;
}

.location-catalog-table {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
    margin-top: 18px;
}

.location-catalog-table > div {
    padding: 12px;
    background: #fff;
    border: 1px solid #e4ded2;
}

.location-catalog-table strong,
.location-catalog-table span {
    display: block;
}

.location-catalog-table strong {
    font-size: 12px;
}

.location-catalog-table span {
    margin-top: 4px;
    color: #777;
    font-size: 10px;
}

.location-pref-row select {
    min-height: 42px;
    margin: 0;
}

@media (max-width: 1000px) {
    .location-admin-grid,
    .location-catalog-table {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 650px) {
    .location-admin-grid,
    .location-catalog-table,
    .location-summary-grid {
        grid-template-columns: 1fr;
    }

    .location-pref-footer {
        align-items: stretch;
        flex-direction: column;
    }
}


/* =========================================================
   KS MANAGER v0.5.5
   Matching e historial comercial
   Autor: Codilogic
   ========================================================= */

.preference-secondary-title {
    margin-top: 24px;
}

.feature-required:has(input:checked) {
    background: #f0e3dd !important;
    border-color: #9e4f43 !important;
    box-shadow: inset 0 0 0 1px #9e4f43 !important;
}

.feature-preferred:has(input:checked) {
    background: #f2ead6 !important;
    border-color: #b99a55 !important;
    box-shadow: inset 0 0 0 1px #b99a55 !important;
}

.match-card-topline,
.history-title-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.followup-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 5px 8px;
    background: #ece8df;
    color: #4c463c;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.followup-pending {
    background: #eee9df;
    color: #716753;
}

.followup-offered {
    background: #eee4cb;
    color: #725c2f;
}

.followup-interested {
    background: #dcebe2;
    color: #315c43;
}

.followup-visited {
    background: #dfe8ef;
    color: #35566e;
}

.followup-discarded {
    background: #efe0de;
    color: #873d35;
}

.followup-closed {
    background: #1d1d1d;
    color: #fff;
}

.match-detail {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 10px 12px;
    font-size: 10px;
    line-height: 1.5;
}

.match-detail strong {
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.match-detail-ok {
    background: #eef5f0;
    color: #315c43;
}

.match-detail-missing {
    background: #faf4e8;
    color: #7b6432;
}

.btn-whatsapp {
    border-color: #cfded4;
    background: #eef5f0;
    color: #315c43;
}

.btn-whatsapp:hover {
    background: #315c43;
    color: #fff;
}

.manual-followup-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) 180px minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 22px;
    padding: 18px;
    background: #faf9f6;
    border: 1px solid #e3ddd1;
}

.manual-followup-form select,
.manual-followup-form input {
    margin-top: 7px;
    min-height: 42px;
}

.history-row-rich {
    align-items: stretch;
}

.history-property p {
    margin: 5px 0 0;
    color: #777;
    font-size: 11px;
}

.history-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 15px;
    color: #777;
    font-size: 10px;
}

.history-dates strong {
    margin-right: 4px;
    color: #333;
}

.history-whatsapp {
    display: inline-block;
    margin-top: 13px;
    color: #315c43;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.history-whatsapp:hover {
    text-decoration: underline;
}

.history-form-rich {
    grid-template-columns: 170px minmax(280px, 1fr) auto;
    align-items: end;
}

.history-form-rich label {
    display: block;
}

.history-form-rich textarea {
    min-height: 72px;
    margin-top: 7px;
}

@media (max-width: 1100px) {
    .manual-followup-form {
        grid-template-columns: 1fr 1fr;
    }

    .history-form-rich {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .manual-followup-form {
        grid-template-columns: 1fr;
    }

    .history-dates {
        flex-direction: column;
        gap: 5px;
    }
}


/* =========================================================
   KS Manager v0.6.0 - feedback de guardado de inmuebles
   ========================================================= */

.property-save-feedback {
    margin: 0 0 20px;
    padding: 16px 18px;
    border-left: 4px solid #222;
    background: #fff;
    font-size: 12px;
    line-height: 1.55;
}

.property-save-feedback[hidden] {
    display: none !important;
}

.property-save-feedback strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.property-save-feedback ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.property-save-error {
    border-left-color: #aa3e34;
    background: #fbefed;
    color: #71302a;
}

.property-save-saving {
    border-left-color: #b99a55;
    background: #faf5e8;
    color: #5f4a20;
}

.property-form button[type="submit"]:disabled {
    opacity: .58;
    cursor: wait;
}


/* =========================================================
   KS Manager v0.6.1 - Agenda comercial
   Autor: Codilogic
   ========================================================= */

.heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line);
}

.agenda-filter-form {
    min-width: 240px;
}

.agenda-filter-form select {
    min-width: 220px;
    margin-top: 6px;
}

.agenda-month-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.agenda-month-nav strong {
    min-width: 175px;
    text-align: center;
    font-size: 17px;
    font-weight: 500;
}

.agenda-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, .75fr);
    gap: 18px;
    align-items: start;
}

.agenda-calendar-card,
.agenda-day-panel {
    background: #fff;
    border: 1px solid var(--line);
}

.agenda-week-head,
.agenda-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-week-head {
    border-bottom: 1px solid var(--line);
}

.agenda-week-head span {
    padding: 12px 8px;
    color: #777;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.agenda-day {
    min-height: 135px;
    padding: 10px;
    border-right: 1px solid #e7e2d9;
    border-bottom: 1px solid #e7e2d9;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease;
}

.agenda-day:nth-child(7n) {
    border-right: 0;
}

.agenda-day:hover {
    background: #faf7ef;
}

.agenda-day.is-other-month {
    background: #fafafa;
    color: #aaa;
}

.agenda-day.is-selected {
    background: #f5efdf;
    box-shadow: inset 0 0 0 2px var(--gold);
}

.agenda-day.is-today .agenda-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #171717;
    color: #fff;
}

.agenda-day-number-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agenda-day-number {
    font-size: 13px;
    font-weight: 700;
}

.agenda-day-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: #111;
    font-size: 9px;
}

.agenda-day-preview {
    display: grid;
    gap: 5px;
    margin-top: 10px;
}

.agenda-day-preview span {
    display: block;
    overflow: hidden;
    padding: 4px 5px;
    background: #f1efe9;
    color: #4d4d4d;
    font-size: 8px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-day-preview span b {
    margin-right: 3px;
}

.agenda-day-preview em {
    color: #8a7b5c;
    font-size: 8px;
    font-style: normal;
}

.agenda-day-panel {
    position: sticky;
    top: 94px;
    overflow: hidden;
}

.agenda-day-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.agenda-day-panel-head h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 500;
}

.agenda-day-panel-head p {
    margin: 5px 0 0;
    color: var(--muted);
}

.agenda-empty-day {
    padding: 35px 24px;
    color: var(--muted);
}

.agenda-day-list {
    max-height: 500px;
    overflow-y: auto;
}

.agenda-task-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid #ece7de;
    border-left: 3px solid #b99a55;
}

.agenda-task-card.agenda-status-done {
    opacity: .65;
    border-left-color: #557762;
}

.agenda-task-card.agenda-status-cancelled {
    opacity: .55;
    border-left-color: #9c5149;
}

.agenda-task-time {
    padding-top: 3px;
    color: var(--gold-dark);
    font-size: 18px;
    font-weight: 700;
}

.agenda-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 5px;
}

.agenda-task-meta span {
    padding: 4px 6px;
    background: #eeeae1;
    color: #5f584b;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.agenda-task-content h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.agenda-task-content p {
    margin: 4px 0;
    color: #727272;
    font-size: 11px;
    line-height: 1.5;
}

.agenda-task-content p a {
    color: #4e4430;
}

.agenda-edit-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.agenda-whatsapp-box {
    padding: 24px;
    background: #f7f5ef;
    border-top: 1px solid var(--line);
}

.agenda-whatsapp-box h3 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 500;
}

.agenda-whatsapp-box textarea {
    min-height: 175px;
    background: #fff;
    font-size: 11px;
    line-height: 1.6;
}

.agenda-whatsapp-button {
    width: 100%;
    margin-top: 10px;
}

.agenda-warning {
    margin: 10px 0 0;
    color: #8c4c44;
    font-size: 11px;
}

.agenda-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.agenda-copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: stretch;
}

.agenda-copy-row input {
    margin-top: 0;
}

.agenda-security-note {
    margin: 12px 0 0;
    color: #8a7b5c;
    font-size: 10px;
}

.agenda-add-assignee {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.agenda-add-assignee summary {
    cursor: pointer;
    color: var(--gold-dark);
    font-size: 11px;
    font-weight: 700;
}

.agenda-add-assignee form {
    display: grid;
    gap: 15px;
    margin-top: 18px;
}

.agenda-task-form-card small {
    display: block;
    margin-top: 7px;
    color: #888;
    font-size: 9px;
    font-weight: 400;
}

.agenda-danger-zone {
    margin-top: 22px;
}

.agenda-related-list,
.agenda-dashboard-list {
    display: grid;
    gap: 8px;
}

.agenda-related-row,
.agenda-dashboard-row {
    display: grid;
    grid-template-columns: 150px 1fr 140px;
    gap: 15px;
    align-items: center;
    padding: 12px 14px;
    background: #faf9f6;
    border: 1px solid #e5e0d7;
    color: inherit;
    text-decoration: none;
}

.agenda-related-row:hover,
.agenda-dashboard-row:hover {
    border-color: var(--gold);
}

.agenda-related-row strong,
.agenda-dashboard-row strong {
    font-size: 11px;
}

.agenda-related-row span,
.agenda-dashboard-row span {
    font-size: 12px;
}

.agenda-related-row small,
.agenda-dashboard-row small {
    color: #777;
    text-align: right;
}

.dashboard-agenda-panel {
    margin-top: 18px;
}

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

    .agenda-day-panel {
        position: static;
    }
}

@media (max-width: 850px) {
    .agenda-settings-grid {
        grid-template-columns: 1fr;
    }

    .agenda-day {
        min-height: 90px;
        padding: 7px;
    }

    .agenda-day-preview span {
        display: none;
    }

    .agenda-related-row,
    .agenda-dashboard-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .agenda-related-row small,
    .agenda-dashboard-row small {
        text-align: left;
    }
}

@media (max-width: 650px) {
    .agenda-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-month-nav {
        justify-content: space-between;
    }

    .agenda-calendar-card {
        overflow-x: auto;
    }

    .agenda-week-head,
    .agenda-calendar-grid {
        min-width: 700px;
    }

    .agenda-day-panel-head {
        flex-direction: column;
    }

    .agenda-copy-row {
        grid-template-columns: 1fr;
    }
}


/* KS Manager v0.6.2 - eliminación segura de responsables */
.agenda-delete-assignee-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2ddd3;
}

.btn-danger {
    border: 1px solid #a4433b;
    background: #fff;
    color: #8d332c;
}

.btn-danger:hover {
    background: #8d332c;
    color: #fff;
}

.agenda-delete-help {
    margin: 8px 0 0;
    max-width: 540px;
    color: #7a746c;
    font-size: 10px;
    line-height: 1.45;
}


/* =========================================================
   KS Manager v0.6.3 - agenda operativa + cliente
   ========================================================= */

.agenda-task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-top: 12px;
}

.agenda-client-whatsapp,
.agenda-client-calendar {
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

.agenda-client-whatsapp {
    color: #315c43;
}

.agenda-client-calendar {
    color: #725c2f;
}

.agenda-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #ece7de;
}

.agenda-quick-actions form {
    margin: 0;
}

.agenda-quick-actions button {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #d8d2c7;
    background: #fff;
    color: #4e4941;
    cursor: pointer;
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.agenda-quick-actions button:hover {
    background: #f4f1eb;
}

.agenda-quick-actions .is-done {
    border-color: #a7c2ae;
    color: #315c43;
}

.agenda-quick-actions .is-cancelled {
    border-color: #d3aaa5;
    color: #873d35;
}

.agenda-client-share-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ded8cc;
    background: #faf9f6;
}

.agenda-client-share-card h2 {
    margin: 4px 0 5px;
}

.agenda-client-share-card p {
    margin: 0;
    color: #777;
    font-size: 11px;
}

.agenda-client-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .agenda-client-share-card {
        display: block;
    }

    .agenda-client-share-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }
}


/* =========================================================
   KS Manager v0.6.4 - Vista semanal Drag & Drop
   ========================================================= */

.agenda-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.agenda-week-section {
    margin-top: 18px;
    border: 1px solid #ddd7cc;
    background: #fff;
}

.agenda-week-intro {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e7e2d9;
}

.agenda-week-intro h2 {
    margin: 4px 0 5px;
}

.agenda-week-intro p {
    margin: 0;
    color: #777;
    font-size: 11px;
}

.agenda-drag-feedback {
    max-width: 350px;
    padding: 10px 12px;
    background: #f5f2ec;
    color: #6b6358;
    font-size: 10px;
    line-height: 1.4;
}

.agenda-drag-feedback.is-saving {
    background: #faf5e8;
    color: #725c2f;
}

.agenda-drag-feedback.is-success {
    background: #eaf3ed;
    color: #315c43;
}

.agenda-drag-feedback.is-error {
    background: #f8e9e6;
    color: #873d35;
}

.agenda-week-scroll {
    overflow: auto;
    max-height: 72vh;
}

.agenda-week-board {
    display: grid;
    grid-template-columns: 68px repeat(7, minmax(150px, 1fr));
    min-width: 1120px;
}

.agenda-week-corner,
.agenda-week-day-head {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 66px;
    border-right: 1px solid #e6e1d8;
    border-bottom: 1px solid #d8d1c5;
    background: #f8f6f2;
}

.agenda-week-corner {
    left: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    color: #857d70;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.agenda-week-day-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #4b463e;
    text-decoration: none;
}

.agenda-week-day-head span {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.agenda-week-day-head strong {
    font-size: 18px;
}

.agenda-week-day-head.is-today {
    background: #eee5d1;
    color: #6b5628;
}

.agenda-week-time-label {
    position: sticky;
    left: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 74px;
    padding-top: 8px;
    border-right: 1px solid #d8d1c5;
    border-bottom: 1px solid #eeeae2;
    background: #faf9f6;
    color: #81796d;
    font-size: 9px;
    font-weight: 700;
}

.agenda-week-cell {
    min-height: 74px;
    padding: 5px;
    border-right: 1px solid #eeeae2;
    border-bottom: 1px solid #eeeae2;
    background: #fff;
    transition: background .12s ease, box-shadow .12s ease;
}

.agenda-week-cell.is-drop-target {
    background: #f4eddb;
    box-shadow: inset 0 0 0 2px #b99a55;
}

.agenda-week-task {
    position: relative;
    margin-bottom: 5px;
    padding: 8px 8px 7px;
    border-left: 3px solid #b99a55;
    background: #f6f2e9;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.agenda-week-task:active {
    cursor: grabbing;
}

.agenda-week-task.is-dragging {
    opacity: .45;
}

.agenda-week-task.is-saving {
    opacity: .6;
    pointer-events: none;
}

.agenda-week-task.is-touch-selected {
    box-shadow: 0 0 0 2px #b99a55;
}

.agenda-week-task.is-locked {
    opacity: .62;
    cursor: default;
}

.agenda-week-task.agenda-status-done {
    border-left-color: #64856d;
    background: #edf4ef;
}

.agenda-week-task.agenda-status-cancelled {
    border-left-color: #a45b53;
    background: #f7ecea;
}

.agenda-week-task.agenda-status-confirmed {
    border-left-color: #5d7c93;
    background: #eef3f6;
}

.agenda-week-task-top {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #746c60;
    font-size: 8px;
    text-transform: uppercase;
}

.agenda-drag-handle {
    color: #9f927d;
    font-size: 14px;
    line-height: 1;
}

.agenda-week-task-top strong {
    color: #282522;
    font-size: 10px;
}

.agenda-week-task h4 {
    margin: 5px 0 4px;
    color: #25221f;
    font-size: 10px;
    line-height: 1.25;
}

.agenda-week-task small {
    display: block;
    margin-top: 2px;
    color: #777066;
    font-size: 8px;
    line-height: 1.25;
}

.agenda-week-edit {
    display: inline-block;
    margin-top: 6px;
    color: #725c2f;
    font-size: 8px;
    font-weight: 700;
    text-decoration: none;
}

.agenda-touch-hint {
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid #e7e2d9;
    background: #faf9f6;
    color: #6f685d;
    font-size: 10px;
}

@media (max-width: 900px) {
    .agenda-week-intro {
        display: block;
    }

    .agenda-drag-feedback {
        max-width: none;
        margin-top: 12px;
    }

    .agenda-week-scroll {
        max-height: 68vh;
    }
}


/* =========================================================
   KS Manager v0.6.5 - menú Ajustes + favicon
   Autor: Codilogic
   ========================================================= */

.topbar nav {
    align-items: center;
}

.nav-dropdown {
    position: relative;
    margin: 0;
}

.nav-dropdown summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    color: rgba(255,255,255,.72);
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    user-select: none;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::after {
    content: "⌄";
    position: relative;
    top: -1px;
    color: var(--gold);
    font-size: 11px;
    transition: transform .15s ease;
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover {
    color: var(--gold);
}

.nav-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 13px);
    left: 50%;
    z-index: 150;
    width: 280px;
    padding: 8px;
    transform: translateX(-50%);
    border: 1px solid rgba(185,154,85,.35);
    background: #1c1c1c;
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translateX(-50%) rotate(45deg);
    border-left: 1px solid rgba(185,154,85,.35);
    border-top: 1px solid rgba(185,154,85,.35);
    background: #1c1c1c;
}

.topbar nav .nav-dropdown-menu a {
    position: relative;
    z-index: 1;
    display: block;
    padding: 13px 14px;
    color: #fff;
    text-decoration: none;
}

.topbar nav .nav-dropdown-menu a + a {
    border-top: 1px solid rgba(255,255,255,.08);
}

.topbar nav .nav-dropdown-menu a:hover {
    background: rgba(185,154,85,.09);
    color: #fff;
}

.nav-dropdown-menu strong,
.nav-dropdown-menu small {
    display: block;
}

.nav-dropdown-menu strong {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.nav-dropdown-menu small {
    margin-top: 4px;
    color: rgba(255,255,255,.48);
    font-size: 9px;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 1200px) {
    .topbar {
        grid-template-columns: 220px 1fr auto;
        gap: 20px;
        padding-left: 22px;
        padding-right: 22px;
    }

    .topbar nav {
        gap: 18px;
    }
}


/* =========================================================
   KS Manager v0.6.6 - reparación de layout / ajustes
   ========================================================= */

/* El footer vuelve a formar parte del layout, sin flotar ni superponerse. */
body.app-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.app-page > .topbar {
    flex: 0 0 auto;
}

body.app-page > .main {
    flex: 1 0 auto;
}

.app-footer {
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding: 0;
    border-top: 1px solid var(--line);
    background: #eeeae2;
    color: #746f66;
    text-align: left;
}

.app-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: calc(100% - 60px);
    max-width: 1500px;
    min-height: 58px;
    margin: 0 auto;
    font-size: 10px;
}

.app-footer-inner strong,
.app-footer-inner span {
    display: inline-block;
}

.app-footer-inner strong {
    margin-right: 7px;
    color: #302d29;
    font-size: 11px;
}

.app-footer-meta {
    display: flex;
    gap: 7px;
    align-items: center;
}

.app-footer-separator {
    color: var(--gold-dark);
}

/* Hub de Ajustes: sin desplegables ni JS especial. */
.settings-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.settings-hub-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    min-height: 230px;
    padding: 32px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.settings-hub-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 14px 34px rgba(0,0,0,.06);
}

.settings-hub-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d8c89d;
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 700;
}

.settings-hub-card h2 {
    margin: 5px 0 10px;
    font-size: 24px;
    font-weight: 500;
}

.settings-hub-card p {
    max-width: 540px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.settings-hub-card > strong {
    grid-column: 2;
    align-self: end;
    color: var(--gold-dark);
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.settings-back-row {
    margin-bottom: 16px;
}

.settings-back-link {
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.page-heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.wp-linked-properties {
    margin-top: 20px;
}

.wp-linked-list {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.wp-linked-row {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr);
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--line);
    background: #faf9f6;
}

.wp-linked-row.is-error {
    border-color: #d7aaa5;
    background: #fbefed;
}

.wp-linked-row.is-ok {
    border-color: #b8ccbE;
    background: #eef5f0;
}

.wp-linked-state {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    background: #171717;
    color: #fff;
    font-weight: 700;
}

.wp-linked-row.is-error .wp-linked-state {
    background: var(--danger);
}

.wp-linked-row.is-ok .wp-linked-state {
    background: var(--success);
}

.wp-linked-main strong,
.wp-linked-main span,
.wp-linked-main small {
    display: block;
}

.wp-linked-main span {
    margin-top: 4px;
    color: #645f57;
    font-size: 10px;
}

.wp-linked-main small {
    margin-top: 5px;
    color: #7a746c;
    line-height: 1.45;
}

@media (max-width: 800px) {
    .settings-hub-grid {
        grid-template-columns: 1fr;
    }

    .app-footer-inner {
        display: block;
        width: calc(100% - 30px);
        padding: 15px 0;
        text-align: center;
    }

    .app-footer-meta {
        justify-content: center;
        margin-top: 6px;
    }
}


/* =========================================================
   KS Manager v0.6.7
   Imagen corporativa únicamente en LOGIN y HEADER
   Autor: Codilogic
   ========================================================= */

/*
 * Fondo genérico del panel.
 * No se aplica ningún fondo al contenido interior del CRM.
 */
:root {
    --ks-corporate-image:
        linear-gradient(135deg, #171717, #2d2d2d);
}

/* ---------------------------------------------------------
   HEADER DEL CRM
   --------------------------------------------------------- */
body.app-page .topbar {
    position: sticky;
    overflow: visible;
    background-color: #171717;
    background-image:
        linear-gradient(
            90deg,
            rgba(10, 10, 10, .91) 0%,
            rgba(10, 10, 10, .82) 45%,
            rgba(10, 10, 10, .72) 100%
        ),
        var(--ks-corporate-image);
    background-size: cover;
    background-position: center 46%;
    background-repeat: no-repeat;
}

/*
 * Mantiene todo el contenido del header perfectamente legible.
 * No modifica tipografía ni tamaños.
 */
body.app-page .topbar .brand,
body.app-page .topbar nav,
body.app-page .topbar .user-menu {
    position: relative;
    z-index: 2;
}

/* ---------------------------------------------------------
   LOGIN
   --------------------------------------------------------- */
body.guest-page {
    background: #111;
}

body.guest-page .guest-main {
    min-height: 100vh;
    justify-content: flex-end;
    padding:
        clamp(28px, 6vh, 70px)
        clamp(25px, 8vw, 140px);
    background-color: #111;
    background-image:
        linear-gradient(
            90deg,
            rgba(7, 7, 7, .18) 0%,
            rgba(7, 7, 7, .26) 48%,
            rgba(7, 7, 7, .58) 100%
        ),
        var(--ks-corporate-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/*
 * La tarjeta sigue siendo sólida y clara para que la imagen
 * no afecte a la lectura ni al formulario.
 */
body.guest-page .auth-card {
    position: relative;
    z-index: 2;
    border-color: rgba(185, 154, 85, .55);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .32);
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 760px) {
    body.guest-page .guest-main {
        justify-content: center;
        padding: 24px 18px;
        background-position: 68% center;
    }

    body.guest-page .auth-card {
        max-width: 470px;
    }

    body.app-page .topbar {
        background-position: 65% center;
    }
}


/* =========================================================
   KS Manager v0.7.5 - buscador inmuebles + llaves + login
   Autor: Codilogic
   ========================================================= */

:root {
    --ks-font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --ks-font-display: Georgia, "Times New Roman", serif;
}

body {
    font-family: var(--ks-font-body);
    text-rendering: optimizeLegibility;
}

.page-heading h1,
.panel-card h2,
.form-card-title h2,
.empty-state h2,
.section-heading-row h2,
.auth-brand h1 {
    font-family: var(--ks-font-display);
    font-weight: 400;
    letter-spacing: -.03em;
}

input, select, textarea, button {
    font-family: var(--ks-font-body);
}

/* Buscador de inmuebles */
.property-search-card {
    margin-bottom: 26px;
    padding: 22px;
    border: 1px solid var(--line);
    background: #fff;
}

.property-search-form {
    display: grid;
    grid-template-columns: minmax(300px, 1.7fr) minmax(180px, .65fr) auto auto;
    gap: 14px;
    align-items: end;
}

.property-search-field,
.property-search-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-search-field > span,
.property-search-status > span {
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.property-search-input-wrap {
    position: relative;
}

.property-search-input-wrap input {
    margin-top: 0;
    min-height: 50px;
    padding: 12px 44px 12px 14px;
    background: #fbfaf7;
    border: 1px solid #d8d1c4;
}

.property-search-status select {
    margin-top: 0;
    min-height: 50px;
    background: #fbfaf7;
    border: 1px solid #d8d1c4;
}

.property-search-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ece8df;
    color: #49443c;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
}

.property-search-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #ece7dd;
    color: #5f5a51;
}

.property-search-summary strong {
    color: #171717;
    font-size: 18px;
    font-weight: 700;
}

/* Llaves */
.keys-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.keys-open-list,
.keys-overview-list {
    display: grid;
    gap: 14px;
}

.keys-open-card,
.keys-overview-row {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid #e7e0d3;
    background: #faf9f6;
}

.keys-open-card {
    grid-template-columns: minmax(260px, 1fr) minmax(320px, .9fr);
    align-items: start;
}

.keys-open-card h3,
.property-key-current h3 {
    margin: 7px 0 10px;
    font-size: 22px;
    font-weight: 500;
}

.keys-open-card p,
.property-key-current p {
    margin: 0 0 8px;
    color: #5f5a51;
    line-height: 1.6;
}

.keys-open-card small,
.property-key-current small {
    color: #7b766e;
    line-height: 1.55;
}

.keys-withdraw-form,
.keys-return-form,
.property-key-withdraw,
.property-key-return {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.keys-withdraw-form > label,
.keys-return-form > label,
.property-key-withdraw > label,
.property-key-return > label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.keys-form-wide,
.property-key-notes {
    grid-column: 1 / -1;
}

.keys-form-actions {
    grid-column: 1 / -1;
}

.keys-withdraw-form input,
.keys-withdraw-form select,
.keys-withdraw-form textarea,
.keys-return-form input,
.keys-return-form select,
.property-key-withdraw input,
.property-key-withdraw select,
.property-key-return input,
.property-key-return select {
    margin-top: 0;
    min-height: 46px;
    background: #fff;
}

.keys-withdraw-form textarea {
    min-height: 110px;
}

input[type="datetime-local"] {
    min-width: 0;
    letter-spacing: .01em;
}

.property-key-current {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, .95fr);
    gap: 22px;
    padding: 20px;
    border: 1px solid #e7e0d3;
    background: #faf9f6;
}

.property-key-current.is-out {
    border-left: 4px solid #9c6f3d;
}

.property-key-current.is-in {
    border-left: 4px solid #587858;
}

.keys-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.keys-status-out {
    background: #f4e4d4;
    color: #815224;
}

.keys-status-in {
    background: #e8f2ea;
    color: #31583b;
}

.keys-property-history {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.keys-property-history > strong {
    font-size: 13px;
}

.keys-property-history-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #e8e0d4;
    background: #fcfbf9;
}

.keys-property-history-row small {
    color: #777;
}

.keys-overview-row {
    grid-template-columns: minmax(240px, 1fr) auto auto;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.keys-last-movement {
    color: #7a746c;
    text-align: right;
}

/* Login */
body.guest-page {
    background: #111;
}

body.guest-page .guest-main {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    background-color: #111;
    background-image: linear-gradient(90deg, rgba(7,7,7,.30) 0%, rgba(7,7,7,.52) 48%, rgba(7,7,7,.70) 100%), var(--ks-corporate-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.login-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 520px);
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: clamp(26px, 5vw, 54px);
    gap: clamp(24px, 4vw, 48px);
}

.login-side {
    display: flex;
    align-items: center;
    min-width: 0;
}

.login-side-inner {
    width: min(100%, 620px);
}

.login-site-logo {
    display: block;
    width: min(100%, 560px);
    max-height: 300px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 8px 26px rgba(0,0,0,.26));
}

.login-side-caption {
    margin: 22px 0 0;
    color: rgba(255,255,255,.76);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-card {
    width: 100%;
    max-width: 520px;
    justify-self: end;
    margin-left: auto;
    border-color: rgba(185,154,85,.55);
    box-shadow: 0 28px 70px rgba(0,0,0,.30);
}

.login-auth-brand {
    align-items: flex-start;
    gap: 16px;
}

.auth-brand-copy {
    min-width: 0;
}

.login-auth-brand h1 {
    margin: 0;
    line-height: 1.08;
    font-size: clamp(31px, 4vw, 44px);
    overflow-wrap: anywhere;
}

.login-auth-brand p {
    margin-top: 8px;
    color: var(--muted);
}

.login-card .btn-primary {
    width: 100%;
}

@media (max-width: 1100px) {
    .property-search-form {
        grid-template-columns: minmax(0, 1fr) minmax(170px, .55fr);
    }

    .property-search-form .btn {
        width: 100%;
    }

    .keys-open-card,
    .property-key-current,
    .keys-overview-row {
        grid-template-columns: 1fr;
    }

    .keys-last-movement {
        text-align: left;
    }

    .login-page-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .login-side {
        justify-content: center;
        text-align: center;
    }

    .login-site-logo {
        margin: 0 auto;
        object-position: center;
    }

    .login-card {
        justify-self: center;
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .property-search-card {
        padding: 18px;
    }

    .property-search-form {
        grid-template-columns: 1fr;
    }

    .property-search-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .keys-withdraw-form,
    .keys-return-form,
    .property-key-withdraw,
    .property-key-return {
        grid-template-columns: 1fr;
    }

    .keys-stats-grid {
        grid-template-columns: 1fr;
    }

    body.guest-page .guest-main {
        padding: 24px 16px;
        background-position: 65% center;
    }

    .login-page-grid {
        gap: 22px;
        min-height: auto;
        padding: 0;
    }

    .login-side {
        padding-top: 8px;
    }

    .login-site-logo {
        width: min(92%, 390px);
        max-height: 180px;
    }

    .login-card {
        max-width: 100%;
        padding: 28px 22px;
    }

    .login-auth-brand .brand-mark.large {
        width: 48px;
        height: 48px;
    }

    .login-auth-brand h1 {
        font-size: clamp(28px, 8vw, 36px);
    }

    .keys-property-history-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   KS Manager v0.7.6 - reparación navegación / responsive
   Autor: Codilogic
   ========================================================= */

/* Escritorio: ocultar siempre controles exclusivos de móvil. */
.mobile-menu-toggle,
.mobile-menu-backdrop,
.mobile-bottom-nav {
    display: none !important;
}

body.app-page .topbar {
    grid-template-columns: 245px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    min-height: 76px;
    padding: 0 24px;
    overflow: visible;
}

body.app-page .topbar .brand,
body.app-page .topbar .app-navigation,
body.app-page .topbar .user-menu {
    position: relative;
    z-index: 4;
}

body.app-page .topbar .app-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-width: 0;
}

body.app-page .topbar .app-navigation a {
    white-space: nowrap;
}

body.app-page .topbar .user-menu {
    white-space: nowrap;
}

/* Tablet / móvil: menú lateral y barra inferior. */
@media (max-width: 1100px) {
    body.app-page {
        padding-bottom: 68px;
    }

    body.app-page .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        min-height: 68px;
        padding: 0 18px;
    }

    .topbar .brand {
        min-width: 0;
    }

    .topbar .brand > span:last-child {
        min-width: 0;
    }

    .topbar .brand strong {
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        z-index: 540;
        width: 44px;
        height: 44px;
        padding: 10px;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        margin: 4px auto;
        background: #fff;
        border-radius: 2px;
    }

    body.app-page .topbar .app-navigation {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 530;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        width: min(86vw, 350px);
        padding: 84px 20px 30px;
        overflow-y: auto;
        background: #171717;
        transform: translateX(104%);
        transition: transform .18s ease;
        box-shadow: -18px 0 50px rgba(0,0,0,.28);
    }

    body.app-page .topbar .app-navigation.is-open {
        transform: translateX(0);
    }

    body.app-page .topbar .app-navigation a {
        display: block;
        padding: 14px 10px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        color: rgba(255,255,255,.82);
        font-size: 13px;
        text-decoration: none;
    }

    body.app-page .topbar .app-navigation .nav-primary {
        margin-top: 12px;
        border: 1px solid rgba(185,154,85,.55);
        color: var(--gold);
        text-align: center;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 520;
        display: block !important;
        visibility: hidden;
        background: rgba(0,0,0,.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease, visibility .18s ease;
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .topbar .user-menu {
        display: none;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 500;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: 64px;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid rgba(185,154,85,.26);
        background: rgba(23,23,23,.99);
        box-shadow: 0 -8px 26px rgba(0,0,0,.16);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        padding: 7px 4px;
        border: 0;
        background: transparent;
        color: rgba(255,255,255,.76);
        text-decoration: none;
        cursor: pointer;
        font: inherit;
        font-size: 9px;
    }

    .mobile-bottom-nav a:hover,
    .mobile-bottom-nav button:hover {
        color: var(--gold);
    }

    .mobile-nav-icon {
        color: var(--gold);
        font-size: 18px;
        line-height: 1;
    }

    .main {
        width: calc(100% - 32px);
    }
}

@media (max-width: 650px) {
    body.app-page .topbar {
        min-height: 64px;
        padding: 0 14px;
    }

    .topbar .brand-mark {
        width: 34px;
        height: 34px;
    }

    .topbar .brand small {
        display: none;
    }

    .topbar .brand strong {
        font-size: 13px;
    }
}


/* =========================================================
   KS Manager v0.6.8-safe - PDF público de inmueble
   Autor: Codilogic
   ========================================================= */

.public-pdf-upload {
    align-items: start;
}

.public-pdf-fields {
    display: grid;
    gap: 12px;
    min-width: 360px;
}

.public-pdf-fields label {
    display: grid;
    gap: 7px;
}

.public-pdf-current {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #ded7ca;
    background: #f7f4ed;
    font-size: 11px;
}

.public-pdf-current strong {
    display: block;
    margin-bottom: 5px;
}

.public-pdf-current a {
    color: #8d6f2f;
    font-weight: 700;
}

.public-pdf-remove {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
}

@media (max-width: 800px) {
    .public-pdf-fields {
        min-width: 0;
    }
}


/* KS Manager v0.8.0 - slug SEO automático */
.seo-slug-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    margin-top: 8px;
}
.seo-slug-control input[type="text"] {
    margin-top: 0;
}
.seo-slug-regenerate {
    min-height: 43px;
    white-space: nowrap;
}
@media (max-width: 650px) {
    .seo-slug-control {
        grid-template-columns: 1fr;
    }
    .seo-slug-regenerate {
        width: 100%;
    }
}
