/* FR Estimations Frontend V17 — CSS */
:root {
    --bg: #0b0b0b;
    --panel: #121212;
    --panel2: #181818;
    --text: #f5f2ea;
    --muted: #b6ab95;
    --line: #2f2a24;
    --accent: #b9975b;
    --accent2: #8c6a34;
    --gold: #d4b06a;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; margin: 0; }
img { max-width: 100%; height: auto; }
body {
    background: linear-gradient(180deg, #090909, #14110d);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
}

/* ── Layout app ───────────────────────────────── */
.frf-app {
    display: grid;
    grid-template-columns: 272px 1fr;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────── */
.frf-sidebar {
    background: rgba(10, 10, 10, .97);
    padding: 24px;
    border-right: 1px solid rgba(185, 151, 91, .18);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
}
.frf-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(185, 151, 91, .14);
}
.frf-brand-logo { display: block; width: 52px; height: auto; }
.frf-brand-copy { display: grid; gap: 2px; }
.frf-brand-copy strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    letter-spacing: .04em;
    color: #fff;
}
.frf-brand-copy span {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Nav links */
.frf-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 3px 0;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.frf-nav-link:hover {
    background: rgba(185, 151, 91, .10);
    color: var(--text);
    border-color: rgba(185, 151, 91, .16);
}
.frf-nav-link.is-active {
    background: rgba(185, 151, 91, .15);
    color: #fff;
    border-color: rgba(185, 151, 91, .26);
    font-weight: 600;
}
.frf-nav-icon { font-size: 15px; opacity: .7; width: 18px; text-align: center; flex-shrink: 0; }
.frf-nav-logout { margin-top: 14px; color: rgba(185, 151, 91, .55); }

/* Sous-nav demandes */
.frf-subnav {
    display: none;
    gap: 2px;
    margin: 0 0 8px 18px;
    padding-left: 12px;
    border-left: 1px solid rgba(185, 151, 91, .18);
}
.frf-subnav.is-open { display: grid; }
.frf-subnav-link {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: background .12s, color .12s;
}
.frf-subnav-link:hover, .frf-subnav-link.is-active {
    background: rgba(185, 151, 91, .10);
    color: var(--text);
    border-color: rgba(185, 151, 91, .14);
}

/* ── Main content ─────────────────────────────── */
.frf-main {
    padding: 28px 28px 48px;
    min-width: 0;
    width: 100%;
}

/* Topbar */
.frf-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.frf-topbar-left { display: flex; align-items: flex-start; gap: 12px; }
.frf-topbar-title h1 {
    margin: 0;
    font-size: 28px;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: .01em;
}
.frf-topbar-title p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

/* Mobile toggle */
.frf-mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(185, 151, 91, .18);
    background: rgba(10, 10, 10, .92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
}
.frf-mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}
.frf-mobile-toggle-inline { display: none; }
.screen-reader-text { position: absolute; left: -9999px; }

/* ── Cards KPI ────────────────────────────────── */
.frf-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.frf-card, .frf-panel {
    background: rgba(18, 18, 18, .92);
    border: 1px solid rgba(185, 151, 91, .14);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    overflow: hidden;
    min-width: 0;
}
.frf-kpi-card { text-align: center; }
.frf-kpi { font-size: 36px; font-weight: 800; margin-bottom: 6px; color: var(--gold); }
.frf-card h3 { margin-top: 0; color: #fff; }

/* ── Buttons ──────────────────────────────────── */
.frf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(185, 151, 91, .18);
    background: rgba(18, 18, 18, .95);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background .14s, border-color .14s;
    white-space: nowrap;
}
.frf-btn:hover { background: rgba(185, 151, 91, .10); border-color: rgba(185, 151, 91, .3); }
.frf-btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    color: #0c0a07;
    font-weight: 600;
}
.frf-btn-primary:hover { opacity: .9; }

/* ── Forms ────────────────────────────────────── */
.frf-filters, .frf-form { display: grid; gap: 14px; }
.frf-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.frf-full { grid-column: 1 / -1; }

/* Labels : couleur dorée cohérente avec le branding (correction V15) */
.frf-form label,
.frf-filter-field {
    display: grid;
    gap: 7px;
    font-weight: 600;
    color: var(--muted);
}
.frf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}
.frf-form input,
.frf-form textarea,
.frf-form select,
.frf-filters input,
.frf-filters select {
    width: 100%;
    background: #0e0e0e;
    color: #fff;
    border: 1px solid rgba(185, 151, 91, .16);
    border-radius: 12px;
    padding: 11px 13px;
    box-sizing: border-box;
    font-size: 14px;
}
.frf-form input:focus,
.frf-form textarea:focus,
.frf-form select:focus,
.frf-filters input:focus,
.frf-filters select:focus {
    outline: none;
    border-color: rgba(185, 151, 91, .42);
}
.frf-form textarea { resize: vertical; }

/* Filtres compacts */
.frf-filters-compact {
    grid-template-columns: 2fr minmax(170px, .9fr) minmax(130px, .7fr) minmax(130px, .7fr) auto;
    align-items: end;
    margin-bottom: 16px;
}
.frf-filters-compact .frf-inline-actions { align-self: end; }

/* ── Tables ───────────────────────────────────── */
.frf-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(185, 151, 91, .10);
    border-radius: 16px;
    background: rgba(9, 9, 9, .5);
}
.frf-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.frf-table thead th {
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, .02);
    padding: 12px 16px;
    text-align: left;
}
.frf-table th, .frf-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.frf-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.frf-table tbody tr:last-child td { border-bottom: 0; }
.frf-table a { color: #e9ddc4; text-decoration: none; font-weight: 600; }
.frf-table a:hover { color: #fff; text-decoration: underline; }

/* ── Badges statut ────────────────────────────── */
.frf-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(185, 151, 91, .14);
    border: 1px solid rgba(185, 151, 91, .28);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.frf-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.frf-badge-gold       { background: rgba(212,176,106,.2);  border-color: rgba(212,176,106,.35); color: #f0ca83; }
.frf-badge-status-new    { background: rgba(59,130,246,.14);  border-color: rgba(59,130,246,.28);  color: #93c5fd; }
.frf-badge-status-wait   { background: rgba(234,179,8,.14);   border-color: rgba(234,179,8,.28);   color: #fde68a; }
.frf-badge-status-done   { background: rgba(34,197,94,.14);   border-color: rgba(34,197,94,.28);   color: #86efac; }
.frf-badge-status-expert { background: rgba(20,184,166,.14);  border-color: rgba(20,184,166,.28);  color: #99f6e4; }
.frf-badge-status-closed { background: rgba(148,163,184,.14); border-color: rgba(148,163,184,.28); color: #cbd5e1; }
.frf-badge-status-default{ background: rgba(185,151,91,.14);  border-color: rgba(185,151,91,.28);  color: #ead9b0; }

/* ── Dashboard grid ──────────────────────────── */
.frf-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

/* ── Fiche demande ───────────────────────────── */
.frf-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.frf-detail-header h2 { margin: 0 0 5px; font-family: Georgia, serif; }
.frf-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.frf-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
    gap: 18px;
}
.frf-col-main, .frf-col-side { display: grid; gap: 18px; align-content: start; }

.frf-text-block {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.6;
    color: var(--text);
}
.frf-text-notes { border-color: rgba(185,151,91,.14); }

/* Photos */
.frf-main-image { position: relative; }
.frf-main-image img { width: 100%; height: auto; border-radius: 14px; cursor: zoom-in; }
.frf-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.frf-gallery::-webkit-scrollbar { height: 6px; }
.frf-gallery::-webkit-scrollbar-thumb { background: rgba(185,151,91,.22); border-radius: 999px; }
.frf-gallery img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    cursor: zoom-in;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Historique */
.frf-history { margin: 0; padding-left: 18px; }
.frf-history li { margin: 0 0 9px; font-size: 14px; }
.frf-history-date { color: var(--muted); font-size: 12px; }

/* ── Lightbox ────────────────────────────────── */
.frf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.frf-lightbox__inner {
    position: relative;
    width: min(96vw, 1400px);
    height: min(92vh, 980px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.frf-lightbox__stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.frf-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .1s ease;
    cursor: grab;
    user-select: none;
    will-change: transform;
}
.frf-lightbox__toolbar {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 8px;
    z-index: 2;
}
.frf-lightbox__btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(17, 17, 17, .82);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.frf-lightbox__counter,
.frf-lightbox__hint {
    position: absolute;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(17, 17, 17, .72);
    color: #fff;
    font-size: 12px;
    z-index: 2;
}
.frf-lightbox__counter { left: 16px; top: 14px; }
.frf-lightbox__hint    { left: 16px; bottom: 14px; }

/* ── Login ───────────────────────────────────── */
.frf-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at top, #1a130a, #0b0b0b);
}
.frf-login-card {
    width: min(100%, 440px);
    background: rgba(16, 14, 11, .97);
    border: 1px solid rgba(185, 151, 91, .20);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
}
.frf-login-logo { display: block; max-width: 260px; width: 100%; height: auto; margin: 0 auto 18px; }
.frf-login-kicker {
    text-align: center;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 11px;
    margin-bottom: 10px;
}
.frf-login-card h1 {
    text-align: center;
    font-family: Georgia, serif;
    margin: 0 0 8px;
    color: #fff;
}
.frf-login-card p { text-align: center; color: var(--muted); }
.frf-login-card label { display: block; margin: 0 0 6px; color: var(--muted); }
.frf-login-card input[type=text],
.frf-login-card input[type=password] {
    width: 100%;
    background: #0b0b0b;
    color: #fff;
    border: 1px solid rgba(185, 151, 91, .16);
    border-radius: 12px;
    padding: 12px 14px;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.frf-login-card input[type=submit] {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0c0a07;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
}
.login-remember { margin: 10px 0; color: var(--muted); }

/* ── Header row / inline ─────────────────────── */
.frf-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.frf-header-row h2 { margin: 0; font-family: Georgia, serif; font-size: 18px; }
.frf-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.frf-card-stack { margin-bottom: 16px; }

/* ── Templates ───────────────────────────────── */
.frf-template-body {
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
    margin-top: 8px;
}

/* ── Misc ────────────────────────────────────── */
.frf-helper { margin: -4px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.frf-code-block {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(10, 12, 20, .7);
}
.frf-code-block code { word-break: break-all; font-size: 13px; }

/* Preview export expert */
.frf-preview-box {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}
.frf-preview-box__head { font-weight: 700; margin-bottom: 12px; color: #fff; }
.frf-preview-box__body { display: grid; gap: 12px; }
.frf-preview-meta { font-size: 13px; color: var(--muted); }
.frf-preview-meta span { color: #fff; font-weight: 700; }
.frf-preview-text {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(10,12,20,.6);
    border: 1px solid var(--line);
    line-height: 1.6;
    word-break: break-word;
    font-size: 14px;
}
.frf-preview-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.frf-preview-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* Topbar actions */
.frf-topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Bouton "Nouvelles demandes" avec compteur */
.frf-btn-nouvelles {
    background: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .28);
    color: #93c5fd;
    font-weight: 600;
    gap: 8px;
}
.frf-btn-nouvelles:hover {
    background: rgba(59, 130, 246, .20);
    border-color: rgba(59, 130, 246, .42);
    color: #bfdbfe;
}
.frf-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .28);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

/* ── Miniatures dans la table demandes ─────── */
/* ── Miniature — desktop ───────────────────────── */
.frf-td-thumb {
    width: 60px;
    padding: 8px 10px !important;
    vertical-align: middle;
}
.frf-thumb-link { display: block; line-height: 0; }
.frf-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(185, 151, 91, .18);
    display: block;
    transition: opacity .15s, transform .15s;
}
.frf-thumb-link:hover .frf-thumb {
    opacity: .85;
    transform: scale(1.04);
}
.frf-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px dashed rgba(185, 151, 91, .16);
    color: var(--muted);
    font-size: 18px;
}

@media (max-width: 960px) {
    .frf-topbar-actions { width: 100%; }
    .frf-topbar-actions .frf-btn { width: 100%; justify-content: center; }

    /*
     * Miniature mobile : sort du flux table normal.
     * Elle se positionne en haut à droite de la card responsive,
     * sans label, sans padding-left, sans perturber les autres champs.
     */
    .frf-td-thumb {
        /* Annuler le comportement td block hérité */
        position: absolute !important;
        top: 10px;
        right: 10px;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        min-height: 0 !important;
    }
    /* Masquer le ::before label sur la cellule miniature */
    .frf-td-thumb::before { display: none !important; }

    /* La card a besoin d'un position:relative pour ancrer la miniature */
    .frf-table-responsive tr { position: relative; }

    /* Taille réduite sur mobile : 44px, plus discrète */
    .frf-thumb {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }
    .frf-thumb-empty {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        font-size: 16px;
    }

    /*
     * Décaler le padding-right des autres td pour ne pas être
     * masquées par la miniature (44px + 10px marge + 10px right = 64px)
     */
    .frf-table-responsive td:not(.frf-td-thumb) {
        padding-right: 64px;
    }
}
.frf-overlay { display: none; }
body.frf-menu-open { overflow: hidden; }
body.frf-menu-open .frf-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .55);
    z-index: 40;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 960px) {
    .frf-app { grid-template-columns: 1fr; }

    /* Sidebar en drawer fixe */
    .frf-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(84vw, 300px);
        transform: translateX(-108%);
        transition: transform .22s ease, opacity .2s ease;
        z-index: 50;
        overflow-y: auto;
        height: 100%;
        padding-top: 18px;
    }
    body.frf-menu-open .frf-sidebar { transform: translateX(0); }

    .frf-mobile-toggle-inline { display: flex; }

    .frf-main { padding: 16px 14px 32px; }
    .frf-topbar { gap: 12px; margin-bottom: 18px; }
    .frf-topbar-title h1 { font-size: 22px; line-height: 1.2; }
    .frf-topbar-left { align-items: center; }

    /* Grids → 1 colonne */
    .frf-cards,
    .frf-dashboard-grid,
    .frf-grid-layout,
    .frf-grid-2,
    .frf-filters-compact { grid-template-columns: 1fr; }

    /* Boutons pleine largeur */
    .frf-inline-actions .frf-btn,
    .frf-topbar > .frf-btn { width: 100%; justify-content: center; }
    .frf-detail-meta { flex-wrap: wrap; }

    /* Tables responsive */
    .frf-table-responsive thead { display: none; }
    .frf-table-responsive,
    .frf-table-responsive tbody,
    .frf-table-responsive tr,
    .frf-table-responsive td { display: block; width: 100%; }
    .frf-table-responsive tr {
        background: rgba(255,255,255,.02);
        border: 1px solid rgba(185,151,91,.1);
        border-radius: 14px;
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    .frf-table-responsive td {
        border: 0;
        padding: 7px 0 7px 108px;
        position: relative;
        min-height: 24px;
        word-break: break-word;
        text-align: left;
    }
    .frf-table-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 7px;
        width: 96px;
        color: var(--muted);
        font-weight: 700;
        font-size: 12px;
    }
    .frf-table-wrap { overflow: visible; border: none; background: transparent; }

    /* Lightbox */
    .frf-lightbox { padding: 10px; }
    .frf-lightbox__inner { width: 100%; height: 100%; }

    /* Login */
    .frf-login-wrap { padding: 16px; }
    .frf-login-card { padding: 24px 18px; }

    /* Menu ouvert : masquer le toggle pour éviter le doublon */
    body.frf-menu-open .frf-mobile-toggle-inline { opacity: 0; pointer-events: none; }
}

@media (max-width: 600px) {
    .frf-topbar { flex-direction: column; align-items: stretch; }
    .frf-topbar > .frf-btn { width: 100%; }
    .frf-detail-header { flex-direction: column; }
    .frf-gallery img { width: 78px; height: 78px; }
}

/* ── ID WPForms dans la fiche demande ─────── */
.frf-detail-ids { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.frf-wpforms-id {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
}
.frf-wpforms-id::before {
    content: '⊞';
    font-size: 11px;
    opacity: .6;
}

/* ID interne discret dans la fiche demande */
.frf-detail-id-internal {
    font-size: 11px;
    color: var(--muted);
    opacity: .55;
}

/* ── Alertes système ──────────────────────── */
.frf-alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.frf-alert-success {
    background: rgba(94, 184, 122, .12);
    border: 1px solid rgba(94, 184, 122, .28);
    color: #86efac;
}

/* ── Fichiers HEIC (non affichables nativement) ─── */
.frf-heic-list {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}
.frf-heic-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(185, 151, 91, .18);
    background: rgba(185, 151, 91, .06);
    color: var(--gold, #d4b06a);
    text-decoration: none;
    font-size: 13px;
    transition: background .14s, border-color .14s;
}
.frf-heic-link:hover {
    background: rgba(185, 151, 91, .12);
    border-color: rgba(185, 151, 91, .32);
}
.frf-heic-icon { font-size: 16px; flex-shrink: 0; }
.frf-heic-name { word-break: break-all; color: var(--text, #f5f2ea); }

/* ── Pagination ───────────────────────────── */
.frf-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.frf-pagination-info {
    font-size: 13px;
    color: var(--muted);
    margin-top: 14px;
    text-align: right;
}
.frf-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(185, 151, 91, .16);
    background: rgba(18, 18, 18, .9);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .14s, border-color .14s, color .14s;
    cursor: pointer;
}
.frf-page-btn:hover {
    background: rgba(185, 151, 91, .12);
    border-color: rgba(185, 151, 91, .32);
    color: #fff;
}
.frf-page-btn--active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #0c0a07;
    font-weight: 700;
    cursor: default;
}
.frf-page-btn--disabled {
    opacity: .3;
    cursor: not-allowed;
    pointer-events: none;
}
.frf-page-ellipsis {
    color: var(--muted);
    padding: 0 4px;
    font-size: 14px;
    line-height: 36px;
}

/* Mode clair */
html.fr-light .frf-page-btn {
    background: #f5f0e8;
    border-color: rgba(139, 103, 52, .20);
    color: #1a1510;
}
html.fr-light .frf-page-btn:hover {
    background: #ede8de;
    border-color: rgba(139, 103, 52, .38);
}
html.fr-light .frf-page-btn--active {
    background: linear-gradient(135deg, #b8893a, #8c6a2a);
    color: #fff5e6;
}

@media (max-width: 960px) {
    .frf-pagination { justify-content: center; }
    .frf-pagination-info { text-align: center; }
    .frf-page-btn { min-width: 40px; height: 40px; font-size: 15px; }
}

/* ── Lightbox : flèches latérales + bouton open-in-tab ─── */
.frf-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(17,17,17,.75);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.frf-lightbox__nav:hover { background: rgba(30,30,30,.95); }
.frf-lightbox__nav--prev { left: 14px; }
.frf-lightbox__nav--next { right: 14px; }

/* Bouton "ouvrir dans un onglet" */
.frf-lightbox__btn--open {
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}
.frf-lightbox__btn--open:hover { color: #fff; }

@media (max-width: 960px) {
    /* Flèches masquées sur mobile — swipe suffit */
    .frf-lightbox__nav { display: none !important; }
    .frf-lightbox__btn--open { font-size: 16px; }
}

/* ── Galerie : wrapper + flèches desktop ──────────────── */
.frf-gallery-wrap {
    position: relative;
}
.frf-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(185,151,91,.22);
    background: rgba(12,10,8,.82);
    color: var(--gold, #d4b06a);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .14s, opacity .2s;
    pointer-events: all;
}
.frf-gallery-arrow:hover { background: rgba(20,16,10,.95); }
.frf-gallery-arrow--prev { left: -14px; }
.frf-gallery-arrow--next { right: -14px; }

/* Masquer les flèches galerie sur mobile (swipe natif) */
@media (max-width: 960px) {
    .frf-gallery-arrow { display: none; }
}

/* Mode clair */
html.fr-light .frf-gallery-arrow {
    background: rgba(255,252,246,.88);
    border-color: rgba(139,103,52,.24);
    color: var(--accent, #9a742e);
}
html.fr-light .frf-gallery-arrow:hover { background: #f5f0e8; }

/* ── Bloc photos restructuré ──────────────────── */
.frf-photos-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Barre de navigation entre photo principale et galerie */
.frf-gallery-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 0 12px;
    margin-top: 10px;
}
.frf-gallery-nav-count {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--muted);
    min-width: 48px;
    text-align: center;
}

/* Flèches nav — dans la barre entre photo principale et galerie */
.frf-gallery-nav .frf-gallery-arrow {
    position: static;
    transform: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(185, 151, 91, .22);
    background: rgba(18, 18, 18, .9);
    color: var(--gold, #d4b06a);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .14s, border-color .14s, opacity .2s;
    flex-shrink: 0;
}
.frf-gallery-nav .frf-gallery-arrow:hover {
    background: rgba(185, 151, 91, .12);
    border-color: rgba(185, 151, 91, .38);
}

/* Miniature active */
.frf-gallery img.is-active {
    border: 2px solid var(--accent, #b9975b);
    opacity: 1;
}

/* Supprimer les anciens styles de positionnement absolu des flèches galerie */
.frf-gallery-wrap { position: static; }
.frf-gallery-arrow--prev:not(.frf-gallery-nav .frf-gallery-arrow--prev),
.frf-gallery-arrow--next:not(.frf-gallery-nav .frf-gallery-arrow--next) {
    display: none;
}

/* Mode clair */
html.fr-light .frf-gallery-nav .frf-gallery-arrow {
    background: #f5f0e8;
    border-color: rgba(139, 103, 52, .22);
    color: var(--accent, #9a742e);
}
html.fr-light .frf-gallery-nav .frf-gallery-arrow:hover {
    background: #ede8de;
    border-color: rgba(139, 103, 52, .38);
}
html.fr-light .frf-gallery-nav-count { color: var(--muted); }

/* Sur mobile : flèches nav visibles aussi (centrées dans la barre) */
@media (max-width: 960px) {
    .frf-gallery-nav { padding: 8px 0 10px; gap: 12px; }
    .frf-gallery-nav .frf-gallery-arrow { width: 38px; height: 38px; font-size: 22px; }
}

/* ── Logo mode clair ──────────────────────────── */
/* Le logo est blanc → invisible sur fond beige.
   Le filtre le convertit en brun doré #6b4e1a. */
html.fr-light .frf-brand-logo,
html.fr-light .frf-login-logo {
    filter: brightness(0) sepia(1) saturate(1.4) hue-rotate(5deg) brightness(0.55);
}

/* "Fabien Robaldo" en noir dans la sidebar en mode clair */
html.fr-light .frf-brand-copy strong {
    color: #1a1510 !important;
}

/* ── Cartes experts ───────────────────────────── */
.frf-expert-cards {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.frf-expert-card {
    display: flex;
    flex-direction: column;
    overflow: visible; /* permettre au contenu de respirer */
    word-break: break-word;
    overflow-wrap: break-word;
}
.frf-expert-card h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    line-height: 1.3;
}
.frf-expert-spec {
    font-size: 13px;
    color: var(--gold);
    margin: 0 0 6px 0;
}
.frf-expert-info {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 4px 0;
    word-break: break-all; /* emails longs */
}
.frf-expert-actions {
    margin-top: auto;
    padding-top: 14px;
}

/* ── Croix suppression carte expert ──────────── */
.frf-expert-delete-form {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    padding: 0;
}
.frf-expert-card {
    position: relative; /* nécessaire pour le positionnement absolu de la croix */
}
.frf-expert-delete-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(185, 151, 91, .20);
    background: rgba(30, 20, 10, .7);
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
    padding: 0;
}
.frf-expert-delete-btn:hover {
    background: rgba(180, 40, 40, .85);
    border-color: rgba(220, 60, 60, .40);
    color: #fff;
}

/* Mode clair */
html.fr-light .frf-expert-delete-btn {
    background: rgba(240, 232, 218, .9);
    border-color: rgba(139, 103, 52, .22);
    color: #8B6914;
}
html.fr-light .frf-expert-delete-btn:hover {
    background: rgba(180, 40, 40, .12);
    border-color: rgba(180, 40, 40, .30);
    color: #C0392B;
}

/* Noms experts et modèles en noir en mode clair */
html.fr-light .frf-expert-card h3,
html.fr-light .frf-card h3 {
    color: #1a1510 !important;
}

/* position relative nécessaire pour la croix sur les cartes modèles */
.frf-card-stack { position: relative; }

/* ── Variables de modèles ─────────────────────── */
.frf-variables-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(185, 151, 91, .06);
    border: 1px solid rgba(185, 151, 91, .16);
    border-radius: 12px;
    margin-bottom: 4px;
}
.frf-var-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(185, 151, 91, .35);
    background: rgba(185, 151, 91, .12);
    color: var(--gold, #d4b06a);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, border-color .14s;
    letter-spacing: .01em;
}
.frf-var-badge:hover {
    background: rgba(185, 151, 91, .22);
    border-color: rgba(185, 151, 91, .55);
}

/* Mode clair */
html.fr-light .frf-variables-bar {
    background: rgba(139, 103, 52, .06);
    border-color: rgba(139, 103, 52, .18);
}
html.fr-light .frf-var-badge {
    background: rgba(139, 103, 52, .10);
    border-color: rgba(139, 103, 52, .30);
    color: #7A5A1A;
}
html.fr-light .frf-var-badge:hover {
    background: rgba(139, 103, 52, .20);
}

/* ── Badge statut Pépite ──────────────────────── */
.frf-badge-status-pepite {
    background: linear-gradient(135deg, #b8913a, #8c6a2a);
    color: #0c0a07;
    font-weight: 700;
}
html.fr-light .frf-badge-status-pepite {
    background: linear-gradient(135deg, #c9a44a, #9a742e);
    color: #fff8e6;
}

/* ── Liens ville → Google Maps ────────────────── */
.frf-city-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(185, 151, 91, .4);
    transition: color .14s, border-color .14s;
}
.frf-city-link:hover {
    color: var(--gold, #d4b06a);
    border-bottom-color: var(--gold, #d4b06a);
}
html.fr-light .frf-city-link { border-bottom-color: rgba(139, 103, 52, .35); }
html.fr-light .frf-city-link:hover { color: #8B6914; border-bottom-color: #8B6914; }

/* ── Bloc "Autres nouvelles demandes" ─────────── */
.frf-panel-multi {
    border-color: rgba(185, 151, 91, .28);
}
.frf-multi-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.frf-multi-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(185, 151, 91, .06);
    border: 1px solid rgba(185, 151, 91, .14);
    cursor: pointer;
    transition: background .14s, border-color .14s;
}
.frf-multi-item:hover {
    background: rgba(185, 151, 91, .12);
    border-color: rgba(185, 151, 91, .28);
}
.frf-multi-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--gold, #d4b06a);
    cursor: pointer;
}
.frf-multi-id {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
    min-width: 52px;
}
.frf-multi-title {
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.frf-multi-title:hover { color: var(--gold); }

/* Mode clair */
html.fr-light .frf-multi-item {
    background: rgba(139, 103, 52, .06);
    border-color: rgba(139, 103, 52, .15);
}
html.fr-light .frf-multi-item:hover {
    background: rgba(139, 103, 52, .12);
}
html.fr-light .frf-multi-title { color: #1a1510; }
