.brv-admin-panel {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    margin: 16px 0 24px;
    max-width: 840px;
    padding: 18px;
}

.brv-form {
    display: grid;
    gap: 14px;
    max-width: 720px;
}

.brv-form label {
    display: grid;
    font-weight: 600;
    gap: 6px;
}

.brv-form input,
.brv-form textarea {
    max-width: 100%;
}

.brv-row-actions {
    display: flex;
    gap: 8px;
}

.brv-row-actions form {
    margin: 0;
}

.brv-inventory-selector {
    align-items: end;
    display: flex;
    gap: 12px;
}

.brv-inventory-selector label {
    display: grid;
    font-weight: 600;
    gap: 6px;
    min-width: 280px;
}

.brv-inventory-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 16px 0;
}

.brv-inventory-heading h2,
.brv-inventory-heading p {
    margin: 0;
}

.brv-inventory-heading p {
    color: #64748b;
    margin-top: 4px;
}

.brv-spreadsheet-wrap {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    max-height: 68vh;
    overflow: auto;
}

.brv-spreadsheet {
    border: 0;
    min-width: 1480px;
}

.brv-spreadsheet thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}

.brv-spreadsheet td,
.brv-spreadsheet th {
    vertical-align: middle;
    white-space: nowrap;
}

.brv-spreadsheet input,
.brv-spreadsheet select,
.brv-spreadsheet textarea {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    box-shadow: none;
    min-height: 34px;
    width: 100%;
}

.brv-spreadsheet input[type="number"] {
    min-width: 96px;
}

.brv-spreadsheet textarea {
    min-width: 180px;
    resize: vertical;
}

.brv-sticky-submit {
    background: #fff;
    border-top: 1px solid #dcdcde;
    bottom: 0;
    margin: 0;
    padding: 12px 0;
    position: sticky;
    z-index: 4;
}

.brv-map,
.brv-map * {
    box-sizing: border-box;
}

.brv-map {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #111827;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
    position: relative;
}

.brv-map-header {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 14px;
}

.brv-map-tools {
    display: flex;
    gap: 8px;
}

.brv-map-tools select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 34px;
}

.brv-map-tools button {
    background: #111827;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    min-height: 34px;
    min-width: 34px;
    padding: 6px 10px;
}

.brv-map-header strong {
    font-size: 16px;
}

.brv-map-header span {
    color: #64748b;
    font-size: 13px;
}

.brv-svg-stage {
    background: #f8fafc;
    min-height: 420px;
    overflow: hidden;
}

.brv-svg-stage svg {
    display: block;
    height: clamp(420px, 70vh, 760px);
    min-height: 420px;
    touch-action: none;
    user-select: none;
    width: 100%;
}

.brv-lot-shape {
    cursor: pointer;
    fill-opacity: .72;
    pointer-events: auto !important;
    transition: fill-opacity .16s ease, filter .16s ease;
}

.brv-lot-shape:hover {
    fill-opacity: .95;
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, .3));
}

.brv-lot-mine {
    stroke: #111827 !important;
    stroke-width: 3 !important;
}

.brv-lot-hidden {
    display: none;
}

.brv-lot-popup {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    bottom: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .2);
    max-width: calc(100% - 32px);
    padding: 16px;
    position: absolute;
    right: 16px;
    width: 300px;
    z-index: 5;
}

.brv-lot-tooltip {
    background: rgba(17, 24, 39, .92);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    left: 0;
    max-width: 220px;
    padding: 7px 9px;
    pointer-events: none;
    position: absolute;
    top: 0;
    z-index: 6;
}

.brv-status-pill {
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    padding: 5px 10px;
}

.brv-status-pill[data-brv-status="disponible"] { background: #16a34a; }
.brv-status-pill[data-brv-status="apartado"] { background: #ca8a04; }
.brv-status-pill[data-brv-status="pagando"] { background: #2563eb; }
.brv-status-pill[data-brv-status="vendido"] { background: #dc2626; }
.brv-status-pill[data-brv-status="promocion"] { background: #a855f7; }
.brv-status-pill[data-brv-status="oculto"] { background: #111827; }
.brv-status-pill[data-brv-status="bloqueado"] { background: #6b7280; }

.brv-popup-close {
    background: #f1f5f9;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    height: 28px;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 28px;
}

.brv-lot-popup strong {
    display: block;
    font-size: 18px;
    margin: 0 34px 12px 0;
}

.brv-lot-popup dl {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

.brv-lot-popup div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.brv-lot-popup dt {
    color: #64748b;
    font-size: 12px;
}

.brv-lot-popup dd {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    text-align: right;
}

.brv-map-error {
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    padding: 14px;
}

.brv-client-form {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 9px;
    padding-top: 12px;
}

.brv-advisor-form {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 9px;
    padding-top: 12px;
}

.brv-advisor-form[hidden],
.brv-client-form[hidden] {
    display: none;
}

.brv-advisor-form label {
    color: #64748b;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 4px;
}

.brv-client-form input,
.brv-advisor-form input,
.brv-advisor-form select,
.brv-advisor-form textarea {
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

.brv-advisor-meta {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    color: #475569;
    font-size: 12px;
    padding: 8px;
}

.brv-client-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}

.brv-primary,
.brv-secondary {
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 9px 10px;
}

.brv-primary {
    background: #111827;
    color: #fff;
}

.brv-secondary {
    background: #e0f2fe;
    color: #075985;
}

@media (max-width: 640px) {
    .brv-map-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .brv-map-tools {
        display: grid;
        grid-template-columns: 1fr 48px 48px 1fr;
        width: 100%;
    }

    .brv-map-tools select {
        grid-column: 1 / -1;
        min-height: 44px;
        width: 100%;
    }

    .brv-map-tools button {
        flex: 1;
        min-height: 44px;
    }

    .brv-svg-stage,
    .brv-svg-stage svg {
        height: 62vh;
        min-height: 340px;
    }

    .brv-lot-popup {
        bottom: 0;
        border-radius: 8px 8px 0 0;
        left: 0;
        max-width: none;
        right: 0;
        width: 100%;
        max-height: 82vh;
        overflow: auto;
    }

    .brv-client-actions {
        grid-template-columns: 1fr;
    }

    .brv-client-form input,
    .brv-advisor-form input,
    .brv-advisor-form select,
    .brv-advisor-form textarea,
    .brv-primary,
    .brv-secondary {
        min-height: 46px;
    }

    .brv-lot-tooltip {
        display: none;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .brv-svg-stage svg {
        height: 78vh;
        min-height: 300px;
    }

    .brv-lot-popup {
        bottom: 8px;
        max-height: calc(100vh - 16px);
        overflow: auto;
        right: 8px;
    }
}
