/**
 * Carte patrimoine — styles page /carte-patrimoine.
 *
 * ID chantier : 2026-09-26-CARTE-PATRIMOINE-MVP
 * Marqueur    : LIOFO_ESTATE_MAP_CSS_2026_09_26
 *
 * Rendu :
 *  - Bulle centrale + établissements en étoile (positions calculées en JS)
 *  - Donut = SVG dans chaque bulle établissement (segments égaux par catégorie)
 *  - Petites bulles de comptes = HTML absolus positionnés autour du donut
 *  - Traits pointillés reliant chaque établissement au centre = SVG parent
 */

.liofo-estate-page {
    background: #0a0a0a;
    color: #f5f5f7;
    min-height: 100vh;
    padding: 24px 16px 64px;
    box-sizing: border-box;
}

.liofo-estate-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.liofo-estate-head {
    text-align: left;
    margin-bottom: 24px;
}

.liofo-estate-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    margin: 0 0 12px;
    color: #ffffff;
}

.liofo-estate-sub {
    color: #cbd5e1;
    line-height: 1.5;
    max-width: 780px;
    margin: 0;
    font-size: 0.98rem;
}
.liofo-estate-sub-hint {
    color: #94a3b8;
    font-size: 0.9rem;
}

.liofo-estate-toolbar {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.liofo-estate-canvas-wrap {
    background: #0f0f10;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px 16px;
    overflow: hidden;
}

.liofo-estate-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 480px;
    max-height: 820px;
}

.liofo-estate-canvas__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* traits pointillés en fond */
}

.liofo-estate-loading,
.liofo-estate-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
    padding: 24px;
}
.liofo-estate-empty__title {
    font-size: 1.1rem;
    color: #e5e7eb;
    margin: 0 0 8px;
}
.liofo-estate-empty__hint {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}

/* --- Bulle centrale « LIOFO » ---------------------------------- */
.liofo-estate-center {
    position: absolute;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: #000000;
    border: 3px solid #1f2937;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: auto;
}
.liofo-estate-center__logo {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #22c55e 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 2px;
}
.liofo-estate-center__label {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Bulle établissement --------------------------------------- */
.liofo-estate-inst {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: auto;
}

.liofo-estate-inst__donut {
    position: relative;
    width: var(--liofo-estate-inst-size, 200px);
    height: var(--liofo-estate-inst-size, 200px);
}

.liofo-estate-inst__center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--liofo-estate-inst-size, 200px) * 0.58);
    height: calc(var(--liofo-estate-inst-size, 200px) * 0.58);
    transform: translate(-50%, -50%);
    background: #000000;
    border: 3px solid #1f2937;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease;
}
.liofo-estate-inst__center:hover {
    border-color: #22c55e;
    transform: translate(-50%, -50%) scale(1.03);
}

.liofo-estate-inst__logo {
    max-width: 60%;
    max-height: 30%;
    object-fit: contain;
    margin-bottom: 4px;
}

.liofo-estate-inst__name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.15;
    margin: 0;
}
.liofo-estate-inst__type {
    color: #94a3b8;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Actions établissement (edit/delete) — visible au hover */
.liofo-estate-inst__actions {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 4;
}
.liofo-estate-inst:hover .liofo-estate-inst__actions,
.liofo-estate-inst:focus-within .liofo-estate-inst__actions {
    opacity: 1;
}
.liofo-estate-inst__action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: #1f2937;
    color: #f5f5f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}
.liofo-estate-inst__action:hover {
    border-color: #22c55e;
}

/* --- Petite bulle compte --------------------------------------- */
.liofo-estate-account {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 68px;
    max-width: 110px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #0a0a0a;
    border: 2px solid rgba(255, 255, 255, 0.14);
    color: #f5f5f7;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.15;
    cursor: pointer;
    z-index: 3;
    transition: border-color 180ms ease, transform 180ms ease;
    white-space: normal;
    word-break: break-word;
}
.liofo-estate-account:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

/* --- Label de catégorie posé au bord du donut ------------------ */
.liofo-estate-category-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
}

/* --- Ajout : bouton + petit ------------------------------------ */
.liofo-estate-add-account {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 3;
    transition: border-color 180ms ease, color 180ms ease;
}
.liofo-estate-add-account:hover {
    border-color: #22c55e;
    color: #22c55e;
}

/* --- Légende catégories ---------------------------------------- */
.liofo-estate-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin-top: 24px;
    padding: 16px;
    background: #0f0f10;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}
.liofo-estate-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.85rem;
}
.liofo-estate-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

/* --- Modales --------------------------------------------------- */
.liofo-estate-modal[hidden] { display: none; }
.liofo-estate-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.liofo-estate-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
}
.liofo-estate-modal__box {
    position: relative;
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 24px 22px 20px;
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.liofo-estate-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.liofo-estate-modal__close:hover { color: #ffffff; }

.liofo-estate-modal__title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 16px;
}

.liofo-estate-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.liofo-estate-form__inst-label {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}
.liofo-estate-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.liofo-estate-field__label {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
}
.liofo-estate-field__hint {
    color: #64748b;
    font-size: 0.75rem;
    font-style: italic;
}
.liofo-estate-field input[type="text"],
.liofo-estate-field input[type="url"],
.liofo-estate-field select,
.liofo-estate-field textarea {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f5f5f7;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 180ms ease;
}
.liofo-estate-field input:focus,
.liofo-estate-field select:focus,
.liofo-estate-field textarea:focus {
    border-color: #22c55e;
}
.liofo-estate-field textarea {
    resize: vertical;
    min-height: 60px;
}

.liofo-estate-form__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* --- Vue guest ------------------------------------------------- */
.liofo-estate-guest {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    background: #0f0f10;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* --- Responsive ------------------------------------------------ */
@media (max-width: 720px) {
    .liofo-estate-canvas {
        aspect-ratio: 3 / 4;
        min-height: 640px;
    }
    .liofo-estate-center {
        width: 96px;
        height: 96px;
    }
    .liofo-estate-center__logo { font-size: 0.95rem; }
    .liofo-estate-center__label { font-size: 0.65rem; }
    .liofo-estate-account {
        min-width: 56px;
        max-width: 90px;
        font-size: 0.68rem;
        padding: 5px 8px;
    }
}
