:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f0f3f9;
    --border: #d9e0ea;
    --text: #1f2937;
    --muted: #6b7280;

    --primary: #0971B7;
    --primary-strong: #075f9a;
    --primary-soft: #eaf4fb;

    --secondary: #3FA9F5;
    --accent: #FF5B00;
    --accent-strong: #e65200;
    --accent-soft: #fff1e8;

    --success: #0f766e;
    --warning: #b45309;
    --danger: #b91c1c;

    --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --container: 1240px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.topbar-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.layout {
    display: flex;
    min-height: calc(100vh - 73px);
}

.sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
}

.sidebar h3 {
    margin-top: 0;
    font-size: 15px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
}

.sidebar nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}

.content-wrap {
    flex: 1;
    padding: 24px;
}

.page-card,
.hero-card,
.content-card,
.panel-card,
.filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-card,
.hero-card,
.content-card {
    padding: 24px;
}

.page-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 34px;
    line-height: 1.15;
}

.section-title {
    margin-top: 32px;
    margin-bottom: 14px;
    font-size: 22px;
}

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.btn,
button,
input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    text-decoration: none;
}

.btn.secondary {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--border);
}

.btn.secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.btn.accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.accent:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn.success {
    background: var(--success);
    border-color: var(--success);
}

.btn.warning {
    background: var(--warning);
    border-color: var(--warning);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.metric-card .label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-card .value {
    font-size: 24px;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

table th,
table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

table th {
    background: var(--surface-2);
}

ul.clean-list,
.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.clean-list li,
.detail-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.messages {
    margin: 0 0 20px 0;
    padding: 0;
    list-style: none;
}

.messages li {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--primary-soft);
    border: 1px solid #c9ddf4;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

form p {
    margin: 0 0 16px 0;
}

label {
    display: inline-block;
    margin-bottom: 6px;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

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

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text);
}

.status-pending { background: #fff7ed; color: #9a3412; }
.status-approved { background: #eff6ff; color: #1d4ed8; }
.status-active { background: #ecfdf5; color: #047857; }
.status-completed { background: #f3f4f6; color: #374151; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-cancelled { background: #fef2f2; color: #991b1b; }

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.image-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface);
}

.image-card img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.muted {
    color: var(--muted);
}

.container-narrow,
.container-wide {
    width: 100%;
    margin: 0 auto;
}

.container-wide {
    max-width: var(--container);
}

.container-narrow {
    max-width: 1120px;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .content-wrap {
        padding: 16px;
    }

    .page-card,
    .hero-card,
    .content-card {
        padding: 18px;
    }

    .page-title {
        font-size: 28px;
    }
}

.filter-row-inline {
    display: grid;
    grid-template-columns: 1.2fr auto;
    gap: 12px;
    align-items: end;
}

.filter-field-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field-inline label {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}


.detail-page-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: start;
}

.info-stack {
    display: grid;
    gap: 20px;
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow-x: hidden;
}

.info-card h2 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 20px;
}

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

.kv-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.kv-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.kv-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.side-summary-card {
    position: sticky;
    top: 92px;
}

.summary-price {
    font-size: 30px;
    font-weight: 800;
    color: var(--accent);
    margin: 10px 0;
}

.summary-block {
    padding: 12px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.action-column {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.soft-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}

.soft-table th {
    background: #f7f9fc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 12px 14px;
}

.soft-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.soft-table tbody tr:nth-child(even) {
    background: rgba(9, 113, 183, 0.03);
}

.soft-table tbody tr:hover {
    background: rgba(63, 169, 245, 0.08);
}

@media (max-width: 980px) {
    .detail-page-layout {
        grid-template-columns: 1fr;
    }

    .side-summary-card {
        position: static;
    }

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

.backoffice-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    background: linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
}

.backoffice-sidebar {
    background: #0d2236;
    color: #fff;
    padding: 24px 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.backoffice-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px 14px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.backoffice-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0971B7 0%, #3FA9F5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.backoffice-brand-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.backoffice-brand-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.backoffice-nav {
    display: grid;
    gap: 8px;
}

.backoffice-nav-link {
    display: block;
    padding: 11px 14px;
    border-radius: 14px;
    color: #fff;
    background: transparent;
    transition: background 0.15s ease, transform 0.15s ease;
}

.backoffice-nav-link:hover {
    background: rgba(63, 169, 245, 0.14);
    text-decoration: none;
    transform: translateY(-1px);
}

.backoffice-nav-label {
    display: block;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}

.backoffice-nav-help {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.backoffice-nav-section {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    padding: 14px 14px 2px 14px;
}

.backoffice-nav-section:first-child {
    padding-top: 4px;
}

.backoffice-nav-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.backoffice-nav-link-flex {
    flex: 1;
    min-width: 0;
}

.backoffice-nav-plus {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.backoffice-nav-plus:hover {
    background: rgba(63, 169, 245, 0.25);
    text-decoration: none;
}

.backoffice-nav-external {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
}

.backoffice-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.backoffice-topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.backoffice-topbar-left {
    min-width: 0;
}

.backoffice-context-label {
    margin: 0 0 4px 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.backoffice-context-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    color: var(--text);
}

.backoffice-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.backoffice-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.backoffice-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0971B7 0%, #3FA9F5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.backoffice-user-meta {
    min-width: 0;
}

.backoffice-user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.backoffice-user-sub {
    font-size: 12px;
    color: var(--muted);
}

.backoffice-user-actions {
    padding-left: 8px;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.backoffice-user-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.backoffice-content {
    padding: 24px;
    min-width: 0;
}

.backoffice-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.backoffice-breadcrumb {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--muted);
}

.backoffice-page-heading {
    margin: 0 0 8px 0;
    font-size: 32px;
    line-height: 1.15;
}

.backoffice-page-intro {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
}

.backoffice-page-body {
    display: grid;
    gap: 20px;
}


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

.action-column {
    background: var(--surface, #f7f7f5);
    border-radius: 12px;
    padding: 12px;
}

.action-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}

.action-column-title {
    font-size: 14px;
    font-weight: 700;
}

.action-column-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
}

.badge-warning { background: #fdf0d8; color: #855109; }
.badge-accent { background: #e6f1fb; color: #0c447c; }
.badge-pro { background: #f1eafb; color: #4a2f8a; }

.action-column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-column-empty {
    font-size: 13px;
    color: var(--muted);
    padding: 8px 2px;
}

.action-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.action-card-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.action-card-sub {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0 0;
}

.action-card-flag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #791f1f;
    background: #f7c1c1;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.action-card-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.action-card-buttons form {
    flex: 1;
    display: flex;
}

.action-btn {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.action-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    flex: 1;
}

.action-btn-success { background: #dcf0c4; color: #27500a; }
.action-btn-danger { background: #f7c1c1; color: #791f1f; }
.action-btn-warning { background: #fadfa8; color: #633806; }

/* Desktop uniquement : plafond de hauteur + defilement interne par colonne */
@media (min-width: 900px) {
    .action-column-body {
        max-height: 560px;
        overflow-y: auto;
        padding-right: 4px;
    }
}

/* Mobile : colonnes empilees pleine largeur, pas de scroll interne */
@media (max-width: 899px) {
    .action-board {
        grid-template-columns: 1fr;
    }
}



.table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}

table th {
    background: #f7f9fc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

table td {
    padding: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    vertical-align: middle;
}

table tbody tr:nth-child(even) {
    background: rgba(9, 113, 183, 0.03);
}

table tbody tr:hover {
    background: rgba(63, 169, 245, 0.08);
}

table th:first-child {
    border-top-left-radius: 14px;
}

table th:last-child {
    border-top-right-radius: 14px;
}

@media (max-width: 1100px) {
    .backoffice-shell {
        grid-template-columns: 1fr;
    }

    .backoffice-sidebar {
        padding: 18px;
        gap: 18px;
    }

    .backoffice-topbar {
        position: static;
        padding: 16px 18px;
        flex-direction: column;
        align-items: stretch;
    }

    .backoffice-page-head {
        flex-direction: column;
    }

    .backoffice-content {
        padding: 18px;
    }
}

@media (max-width: 720px) {
    .backoffice-user-box {
        width: 100%;
        justify-content: space-between;
    }

    .backoffice-page-heading {
        font-size: 26px;
    }
}

.backoffice-filter-card {
    padding: 18px 20px;
}

.backoffice-filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.backoffice-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.backoffice-filter-field label {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.table-count {
    color: var(--muted);
    font-size: 14px;
}

.action-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .backoffice-filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .backoffice-filter-row {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.action-column form {
    margin: 0;
}


/* ===============================
   PANEL DETAIL LAYOUT
================================= */
.panel-detail-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 20px;
    align-items: start;
}
.qr-print-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.qr-print-area img {
    display: block;
    margin: 0 auto;
}



#qr-print-root {
    display: none;
}

@media print {
    body.is-printing-qr > *:not(#qr-print-root) {
        display: none !important;
    }

    #qr-print-root {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    #qr-print-root img {
        width: 180mm !important;
        max-width: none !important;
        height: auto !important;
        display: block;
    }

    #qr-print-root p {
        font-size: 18pt !important;
        text-align: center;
        margin-top: 10mm;
    }
}
/* ===============================
   GALLERY
================================= */
.panel-main-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
}

.panel-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.panel-thumbnail {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.panel-thumbnail.is-active {
    opacity: 1;
    outline: 2px solid var(--accent);
}

/* ===============================
   LEFT SECTIONS
================================= */
.panel-detail-sections {
    margin-top: 16px;
}

.detail-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.detail-mini-box {
    padding: 14px;
    border-radius: 12px;
    background: rgba(9, 113, 183, 0.05);
}

/* ===============================
   PANEL INFO CARD
================================= */
.panel-info-card {
    padding: 20px;
}

.panel-detail-title {
    font-size: 20px;
    margin-bottom: 6px;
}

.panel-detail-location {
    color: var(--muted);
    margin-bottom: 16px;
}

/* ===============================
   KEY VALUE LIST
================================= */
.panel-kv-list {
    display: grid;
    gap: 10px;
}

.panel-kv-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.panel-kv-item span {
    color: var(--muted);
}

/* ===============================
   FACES LIST
================================= */
.face-option-list {
    display: grid;
    gap: 12px;
}

.face-option {
    padding: 14px;
    border-radius: 12px;
    background: rgba(63, 169, 245, 0.05);
}

.face-option-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.face-option-title {
    font-weight: 700;
}

.face-chip {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
}

/* ===============================
   RIGHT SUMMARY
================================= */
.face-summary-card {
    position: sticky;
    top: 90px;
}

.face-summary-price {
    font-size: 28px;
    font-weight: 800;
    margin: 10px 0;
}

.face-summary-sub {
    color: var(--muted);
    margin-bottom: 14px;
}

.face-summary-map {
    margin-top: 16px;
    font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================= */
@media (max-width: 1100px) {
    .panel-detail-layout {
        grid-template-columns: 1fr;
    }

    .face-summary-card {
        position: static;
    }

    .detail-mini-grid {
        grid-template-columns: 1fr;
    }
}



.form-card,
.form-side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.form-sections {
    display: grid;
    gap: 20px;
}

.form-section-title {
    margin: 0 0 14px 0;
    font-size: 18px;
}

/*FORM FIELD*/
.form-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 20px;
    align-items: start;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.field-help {
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 2px;
}

.field-error {
    color: #dc2626;
    font-size: 14px;
    line-height: 1.4;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
}


#geo-popover-trigger.geo-popover-trigger:hover {
    background: #f7f7f7;
}

.geo-popover { position: relative; }

.geo-popover-trigger#geo-popover-trigger,
.geo-popover-trigger#geo-popover-form-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    background: #fff;
    color: var(--text, #1a1a1a);
    border: 1px solid var(--border, #d5d5d5);
    font-size: 14px;
    font-weight: 400;
}

.geo-popover-trigger#geo-popover-trigger:hover,
.geo-popover-trigger#geo-popover-form-trigger:hover {
    background: #f7f7f7;
}

.geo-popover-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 300px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid var(--border, #d5d5d5);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 14px;
    z-index: 50;
}

.geo-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.geo-level-field { display: flex; flex-direction: column; gap: 4px; }

.geo-level-field label {
    font-size: 12px;
    color: var(--muted, #666);
    font-weight: 600;
}

.geo-list-empty { font-size: 13px; color: var(--muted, #666); }

.geo-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #eee);
}

.geo-clear-btn#geo-clear-btn,
.geo-clear-btn#geo-clear-form-btn {
    background: none;
    border: none;
    color: #0971B7;
    font-weight: 600;
    font-size: 13px;
    padding: 4px;
    text-decoration: underline;
}

.geo-validate-btn#geo-validate-btn,
.geo-validate-btn#geo-validate-form-btn {
    background: #0971B7;
    border-color: #0971B7;
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}


.geo-breadcrumb-readonly {
    font-size: 12px;
    color: var(--muted, #666);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border, #eee);
}

.geo-breadcrumb-crumb.current {
    color: #1a1a1a;
    font-weight: 600;
}

.geo-level-select-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.geo-level-select-row select { flex: 1; }

.geo-level-clear {
    cursor: pointer;
    color: var(--muted, #666);
    font-size: 16px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
}

.geo-level-clear:hover {
    background: #f2f2f2;
    color: #1a1a1a;
}



@media (max-width: 760px) {
    .form-field-grid {
        grid-template-columns: 1fr;
    }
}





.side-note {
    padding: 14px;
    border-radius: 12px;
    background: rgba(63, 169, 245, 0.08);
    color: var(--text);
    margin-bottom: 14px;
}

.form-side-card .detail-list li strong {
    display: inline-block;
    min-width: 110px;
}



.logout-form {
    margin: 0;
}

.logout-button {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.logout-button:hover {
    color: var(--accent);
}

/*==========Formulaire Interrupted==========*/

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay[hidden] {
    display: none !important;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 420px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-title {
    margin-top: 0;
    margin-bottom: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/*================================
IMPORT DE PANNEAUX
================================*/
.import-progress-bar {
    background: var(--surface, #f0f0ee);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.import-progress-fill {
    background: var(--primary);
    height: 100%;
}

.import-wizard-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 899px) {
    .import-wizard-layout {
        grid-template-columns: 1fr;
    }
}

.raw-data-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: top;
}

.raw-data-label {
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.raw-row-sticky {
    overflow-x: hidden;
    max-width: 100%;
}

.raw-grid-scroll {
    -webkit-overflow-scrolling: touch;
}

.face-slot {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}


.raw-grid-scroll {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.content-card {
    overflow-x: hidden;
}

.raw-grid-table {
    border-collapse: collapse;
    white-space: nowrap;
}

.raw-grid-table td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 13px;
}

.raw-grid-header-row td {
    font-weight: 700;
    background: var(--surface, #f5f5f3);
}

.raw-grid-select {
    background: #fff !important;
}

.select-header-btn {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
}

.raw-grid-row:hover td {
    background: var(--primary-soft, #eaf3fb);
}

.faces-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.separator-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fdf0d8;
    border: 1px solid #e8b95c;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 13px;
}


.raw-row-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding: 10px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 14px;
}

.raw-grid-scroll {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.raw-grid-table {
    border-collapse: collapse;
    white-space: nowrap;
}

.raw-grid-table td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 13px;
}

.raw-grid-header-row td {
    font-weight: 700;
    background: var(--surface, #f5f5f3);
}

.raw-grid-select {
    background: #fff !important;
}



.raw-fields-card {
    margin-bottom: 16px;
}

.raw-fields-list {
    display: flex;
    flex-direction: column;
}

.raw-field-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.raw-field-label {
    font-weight: 700;
    color: var(--muted);
    word-break: break-word;
}

.raw-field-value {
    word-break: break-word;
    padding: 2px 6px;
    border-radius: 4px;
}

@media (max-width: 599px) {
    .raw-field-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ===============================
   MOBILE TOPBAR (drawer + profil)
================================= */
.mobile-topbar {
    display: none;
}

.mobile-sidebar-overlay {
    display: none;
}

@media (max-width: 1100px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 60;
        background: #0d2236;
        padding: 10px 14px;
        height: 56px;
        box-sizing: border-box;
    }

    .mobile-menu-toggle {
        background: transparent;
        border: none;
        padding: 8px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
        width: 36px;
        height: 36px;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: #fff;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .mobile-menu-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .mobile-topbar-brand {
        color: #fff;
        font-weight: 800;
        font-size: 17px;
        flex: 1;
        text-align: center;
    }

    .mobile-user-menu {
        position: relative;
    }

    .mobile-user-avatar-btn {
        width: 36px;
        height: 36px;
        border-radius: 999px;
        background: linear-gradient(135deg, #0971B7 0%, #3FA9F5 100%);
        color: #fff;
        border: none;
        font-weight: 800;
        font-size: 14px;
        cursor: pointer;
        padding: 0;
    }

    .mobile-user-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
        padding: 14px;
        width: 200px;
        z-index: 70;
    }

    .mobile-user-dropdown-name {
        font-weight: 700;
        font-size: 14px;
        color: var(--text);
    }

    .mobile-user-dropdown-sub {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 10px;
    }

    .mobile-user-dropdown-logout {
        width: 100%;
        background: var(--surface-2);
        color: var(--danger);
        border: none;
        border-radius: 8px;
        padding: 8px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 39;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.15s ease;
    }

    .mobile-sidebar-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .backoffice-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(280px, 85vw);
        z-index: 40;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
    }

    .backoffice-sidebar.is-open {
        transform: translateX(0);
    }

    .backoffice-topbar-right {
        display: none;
    }
}

@media (min-width: 1101px) {
    .backoffice-shell {
        display: block;
    }

    .backoffice-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        overflow-y: auto;
    }

    .backoffice-main {
        margin-left: 280px;
    }
}

/* ===============================
   FILTRE RÉTRACTABLE BACKOFFICE (mobile)
================================= */
.backoffice-filter-toggle {
    display: none;
}

@media (max-width: 700px) {
    .backoffice-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 10px;
        padding: 13px 16px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        margin: 0;
    }

    .backoffice-filter-toggle-icon {
        transition: transform 0.15s ease;
    }

    .backoffice-filter-toggle.is-open .backoffice-filter-toggle-icon {
        transform: rotate(180deg);
    }

    .backoffice-filter-desktop-title {
        display: none;
    }

    #dashboard-filter-fields,
    #panel-filter-fields {
        display: none;
        margin-top: 14px;
    }

    #dashboard-filter-fields.is-open,
    #panel-filter-fields.is-open {
        display: block;
    }
}

/* ===============================
   KPI GRID MOBILE
================================= */
@media (max-width: 640px) {
    .kpi-grid,
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .metric-card {
        padding: 12px;
    }

    .metric-card .label {
        font-size: 12px;
    }

    .metric-card .value {
        font-size: 20px;
    }

    .metric-card-wide {
        grid-column: 1 / -1;
    }
}


/* ===============================
   PANEL FORM LAYOUT (panneau + face)
================================= */
.panel-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 980px) {
    .panel-form-layout {
        display: flex;
        flex-direction: column;
    }

    .pf-col-side {
        order: 1;
        margin-bottom: 16px;
    }

    .pf-col-form {
        order: 2;
    }
}

/* ===============================
   BLOC REPLIABLE (panneau concerné / règles)
================================= */
/* --- COMPOSANT : ACCORDÉON CONFIGURABLE --- */

/* Style sur Ordinateur (Par défaut) : Aspect Titre, pas de bouton */
.pf-toggle-summary {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px 0 !important; /* Pas de padding bouton */

    /* Dissimulation complète du style bouton */
    background: transparent !important;
    color: var(--text) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important; /* Ligne de séparation élégante */
    border-radius: 0 !important;
    box-shadow: none !important;

    cursor: pointer;
    text-align: left;
    font-weight: bold;
    font-size: 18px; /* Taille similaire à un h2 */
}

/* Survol sur PC : Changement discret de couleur du texte */
.pf-toggle-summary:hover {
    background: transparent !important;
    color: var(--primary) !important;
    text-decoration: none;
}

/* Flèche de l'accordéon */
.pf-toggle-summary .pf-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    transform: rotate(0deg); /* Fermé par défaut */
}

/* Rotation de la flèche quand ouvert */
.pf-toggle-summary.is-open .pf-toggle-icon {
    transform: rotate(90deg) !important;
}


/* --- COMPORTEMENT SUR MOBILE --- */
@media (max-width: 768px) {
    .pf-toggle-summary {
        /* On réactive le look bouton sur mobile pour une zone de clic facile (44px+) */
        background-color: var(--secondary) !important;
        color: #ffffff !important;
        padding: 12px 16px !important;
        border-radius: var(--radius-sm) !important;
        border: none !important;
        font-size: 14px;
    }

    .pf-toggle-summary:hover {
        background-color: var(--primary-strong) !important;
        color: #ffffff !important;
    }

    /* Couleur du bouton mobile quand ouvert */
    .pf-toggle-summary.is-open {
        background-color: var(--primary) !important;
        color: #ffffff !important;
    }
}





.pf-toggle-summary.is-open {
    background-color: var(--primary);
}

.pf-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.pf-toggle-body {
    display: block;
    margin-top: 12px;
}

@media (max-width: 980px) {
    .pf-toggle-icon {
        transform: rotate(0deg);
    }

    .pf-toggle-summary.is-open .pf-toggle-icon {
        transform: rotate(90deg);
    }

    /* 2. Le corps du panneau (Masqué par défaut partout, PC et mobile) */
.pf-toggle-body {
    display: none;
}





    .pf-toggle-body.is-open {
        display: block !important;
    }
}

.panel-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px; /* Le formulaire prend le reste, le côté prend 340px */
    gap: 24px;
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .panel-form-layout {
        grid-template-columns: 1fr; /* Passe sur une seule colonne sur mobile */
    }
}

/* --- COMPOSANT : FILTRE DÉPLIABLE --- */

/* Style par défaut du bouton sur Ordinateur (Ressemble à un simple titre) */
.filter-toggle-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    color: var(--text) !important;
    border: none !important;
    padding: 0 !important;
    cursor: default; /* Pas de curseur main sur PC puisque c'est toujours ouvert */
    text-align: left;
}

/* Cache la flèche par défaut sur Ordinateur */
.filter-toggle-header .filter-toggle-icon {
    display: none;
}

/* Le contenu du filtre est toujours visible sur Ordinateur */
.filter-toggle-body {
    display: block;
}


/* --- COMPORTEMENT SUR MOBILE UNIQUEMENT --- */
@media (max-width: 768px) {
    /* Le titre devient un vrai bouton bleu interactif */
    .filter-toggle-header {
        background-color: var(--primary) !important; /* Bleu clair */
        color: #ffffff !important;
        padding: 12px 16px !important;
        border-radius: var(--radius-sm) !important;
        cursor: pointer;
    }

    .filter-toggle-header .section-title {
        color: #ffffff !important;
        font-size: 16px !important;
    }

    /* Affiche la flèche sur mobile */
    .filter-toggle-header .filter-toggle-icon {
        display: inline-block;
        transition: transform 0.2s ease;
        transform: rotate(0deg); /* Pointe vers la droite */
    }

    /* Masque le contenu du filtre par défaut sur mobile */
    .filter-toggle-body {
        display: none;
    }

    /* --- ÉTATS INTERACTIFS AU CLIC (MOBILE) --- */
    .filter-toggle-body.is-open {
        display: block !important;
    }

    .filter-toggle-header.is-open {
        background-color: var(--primary) !important; /* Devient bleu foncé si ouvert */
    }

    .filter-toggle-header.is-open .filter-toggle-icon {
        transform: rotate(90deg) !important; /* La flèche pointe vers le bas */
    }
}


/* --- ACCORDÉON D'AIDE SUR FORMULAIRE DE RÉSERVATION --- */

/* Sur ordinateur : Aspect Titre/Texte discret (Comme vu précédemment) */
#reservation-help-aside .pf-toggle-summary {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px 0 !important;
    background: transparent !important;
    color: var(--text) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

#reservation-help-aside .pf-toggle-summary:hover {
    background: transparent !important;
    color: var(--primary) !important;
    text-decoration: none;
}

/* Comportement par défaut de la flèche sur ordinateur (Ouvert) */
#reservation-help-aside .pf-toggle-summary .pf-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    transform: rotate(90deg);
}

#reservation-help-aside .pf-toggle-body {
    display: block;
}


/* --- COMPORTEMENT RESPONSIVE (MOBILE) --- */
@media (max-width: 768px) {
    /* Remonte l'aside tout en haut du layout de formulaire */
    .panel-form-layout {
        display: flex;
        flex-direction: column;
    }

    #reservation-help-aside {
        order: -1; /* Force l'élément à se placer en première position */
        margin-bottom: 20px; /* Espace par rapport au formulaire en dessous */

        /* CORRECTION ICI : Force l'aside à s'étirer sur toute la largeur de l'écran */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Redonne l'aspect bouton d'action bleu sur mobile */
    #reservation-help-aside .pf-toggle-summary {
        width: 100%; /* S'assure que le bouton remplit bien l'aside */
        background-color: var(--secondary) !important;
        color: #ffffff !important;
        padding: 12px 16px !important;
        border-radius: var(--radius-sm) !important;
        border: none !important;
        font-size: 14px;
    }

    #reservation-help-aside .pf-toggle-summary:hover {
        background-color: var(--primary-strong) !important;
        color: #ffffff !important;
    }

    /* Couleur du bouton ouvert sur mobile */
    #reservation-help-aside .pf-toggle-summary.is-open {
        background-color: var(--primary) !important;
        color: #ffffff !important;
    }

    /* Masque le contenu par défaut sur mobile */
    #reservation-help-aside .pf-toggle-body {
        display: none;
    }

    /* Force la flèche fermée par défaut sur mobile */
    #reservation-help-aside .pf-toggle-summary .pf-toggle-icon {
        transform: rotate(0deg);
    }

    /* Ouverture au clic */
    #reservation-help-aside .pf-toggle-body.is-open {
        display: block !important;
    }

    #reservation-help-aside .pf-toggle-summary.is-open .pf-toggle-icon {
        transform: rotate(90deg) !important;
    }
}
/* ==========================================================================
   🎯 CORRECTIF CHIRURGICAL - LIBÉRATION DU BLOCAGE DE LARGEUR
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. On force la structure globale à accepter de rétrécir sur mobile */
    .backoffice-main-content,
    .backoffice-content-wrapper,
    main,
    #main-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; /* Débloque la rigidité Flexbox de Django/CSS */
        display: block !important; /* Annule temporairement le grid/flex desktop */
        padding: 10px !important;
        box-sizing: border-box;
    }

    /* 2. On brise la largeur fixe de 1004px du conteneur de l'équipe */
    .management-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important; /* Évite de rajouter des marges superflues */
        display: block !important; /* On s'assure qu'il n'est pas en flex */
        box-sizing: border-box;
    }

    /* 3. On force la barre d'outils à s'empiler verticalement sur mobile */
    .management-container .toolbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        box-sizing: border-box;
    }

    /* On aligne les éléments de la toolbar à 100% de l'écran mobile */
    .management-container .filter-zone,
    .management-container .action-zone,
    .management-container .action-zone .btn {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 4. Maintenant que les parents font bien la largeur du smartphone, */
    /* la boîte responsive va enfin pouvoir activer son scroll de sécurité ! */
    .table-responsive-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important; /* Le scroll apparaît ENFIN ici */
        -webkit-overflow-scrolling: touch !important;
    }
}


