/* ============================================
   ÉTAT DES LIEUX PRO - STYLES CSS
   Version: 1.0.0
   ============================================ */

/* ============================================
   IMPORTS & FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   MATERIAL SYMBOLS (GOOGLE ICONS)
   ============================================ */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 21px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tailles d'icônes */
.icon-sm {
    font-size: 18px;
}

.icon-md {
    font-size: 24px;
}

.icon-lg {
    font-size: 32px;
}

/* Icône dans les boutons */
.btn .material-symbols-rounded,
.btn-nav .material-symbols-rounded {
    vertical-align: middle;
    margin-right: 0.25rem;
}

.btn-nav .material-symbols-rounded {
    font-size: 20px;
}

button.btn.btn-add-small span.material-symbols-rounded {
    font-size: 20px;
}

button.btn-delete-corner span.material-symbols-rounded {
    font-size: 20px;
    /* color: revert-layer; */
}
/* Collapse icons */
.collapse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.collapse-icon .material-symbols-rounded {
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* Rotation pour l'état fermé */
.collapsed .collapse-icon .material-symbols-rounded,
.piece-header.collapsed .collapse-icon .material-symbols-rounded,
.compteur-header.collapsed .collapse-icon .material-symbols-rounded,
.cle-header.collapsed .collapse-icon .material-symbols-rounded {
    transform: rotate(-90deg);
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Couleurs principales */
    --primary: #17294D;
    --primary-light: #2c5282;
    --primary-dark: #2D3748;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;

    /* Couleurs sémantiques */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #129066;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-light: #60a5fa;
    --info-bg: #dbeafe;
    --conseil: #0e563e27;

    /* Couleurs neutres */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-gray: #f1f5f9;
    --text-dark: #2D3748;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --backgnd-bck: #000000; 

    /* Dimensions */
    --header-height: 60px;
    --nav-height: 50px;
    --footer-height: 70px;
    --container-max: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    --border-radius-xl: 30px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px 0px rgba(0, 0, 0, 0.05), 0 2px 4px 1px rgba(0, 0, 0, 0.01);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gray) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mode EDL actif - fond sombre */
body.edl-active {
    background: var(--bg-gray);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--primary-light);
}

/* ============================================
   HEADER
   ============================================ */
/* ============================================
   PAGE D'ACCUEIL
   ============================================ */
.home-page {
    display: none;
    padding: 1.5rem 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.home-page.active {
    display: block;
}

.home-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.home-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.home-search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 25px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bg-light);
}

.home-search .search-icon {
    font-size: 1rem;
    margin-right: 0.75rem;
    color: var(--text-light);
}

.home-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-dark);
    outline: none;
}

.home-search input::placeholder {
    color: var(--text-light);
}

/* Bouton créer EDL flottant */
.btn-create-edl-floating {
    position: fixed;
    bottom: 5rem !important;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem !important;
    padding: 1rem 4rem !important;
    background: var(--success);
    color: white;
    border: none!important;
    border-radius: 30px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
    z-index: var(--z-sticky);
    white-space: nowrap;
}

.btn-create-edl-floating .material-symbols-rounded {
    font-size: 22px;
}

.btn-create-edl-floating:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 174, 112, 0.1);
}

.btn-create-edl-floating:active {
    transform: translateX(-50%) translateY(-1px);
}

/* Masquer quand EDL actif */
.edl-active .btn-create-edl-floating {
    display: none;
}

/* Liste EDL sur accueil */
.edl-list-item {
    display: flex;
    align-items: center;
    padding: 0.875rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.edl-list-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-white);
}

.edl-list-item .edl-color {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    margin-right: 0.875rem;
    flex-shrink: 0;
}

.edl-list-item .edl-color.entree {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.edl-list-item .edl-color.sortie {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.edl-list-item .edl-info {
    flex: 1;
    min-width: 0;
}

.edl-list-item .edl-address {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edl-list-item .edl-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.edl-list-item .edl-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.edl-list-item .edl-status.brouillon {
    background: #fef3c7;
    color: #92400e;
}

.edl-list-item .edl-status.termine {
    background: #d1fae5;
    color: #065f46;
}

.edl-list-item .edl-delete {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.125rem;
    transition: color var(--transition-fast);
    margin-left: 0.5rem;
}

.edl-list-item .edl-delete:hover {
    color: var(--danger);
}

/* ============================================
   NAVIGATION TABS FLOTTANTE
   ============================================ */
.nav-tabs-floating {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-white);
    border-radius: 30px;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.nav-tabs-floating.hidden {
    display: none;
}

/* Slider qui glisse - animé via JS pour synchronisation parfaite */
.nav-slider {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    height: calc(100% - 0.5rem);
    background: var(--primary-dark);
    border-radius: 25px;
    z-index: 0;
    pointer-events: none;
    will-change: left, width;
}

.nav-tabs-floating button {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.5rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: padding 0.15s ease-out, color 0.15s ease-out;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
}

.nav-tabs-floating button .tab-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    width: 1.125rem;
    opacity: 1;
    transition: width 0.15s ease-out, opacity 0.1s ease-out;
}

.nav-tabs-floating button .tab-text {
    display: block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.15s ease-out, opacity 0.1s ease-out;
}

.nav-tabs-floating button:hover:not(.active) {
    color: var(--text-dark);
}

/* Bouton actif - le texte apparaît, l'icône disparaît */
.nav-tabs-floating button.active {
    color: white;
    padding: 0.5rem 1rem;
    transition: padding 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease-out;
}

.nav-tabs-floating button.active .tab-text {
    max-width: 120px;
    opacity: 1;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in 0.1s;
}

.nav-tabs-floating button.active .tab-icon {
    width: 0;
    opacity: 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease-out;
}

/* ============================================
   BOTTOM NAVIGATION FLOTTANTE
   ============================================ */
.bottom-nav-floating {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: var(--z-sticky);
}

.bottom-nav-floating.hidden {
    display: none;
}

/* ============================================
   BOUTON FLOTTANT (FAB - Floating Action Button)
   ============================================ */
.btn-fab {
    position: fixed;
    bottom: 6.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    transition: all var(--transition-fast);
}

.btn-fab:hover {
    background: var(--success-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(41, 238, 120, 0.4);
}

.btn-fab:active {
    transform: scale(0.95);
}

.btn-fab .material-symbols-rounded {
    font-size: 28px;
    font-weight: 500;
}

.btn-fab.hidden {
    display: none;
}

.btn-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-nav-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-nav-secondary:hover {
    background: var(--bg-gray);
}

.btn-nav-primary {
    background: var(--primary);
    color: white;
}

.btn-nav-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-nav:active {
    transform: translateY(0);
}

.btn-nav-icon {
    display: inline-flex;
    align-items: center;
}

.btn-nav-icon .material-symbols-rounded {
    font-size: 1rem;
}

.btn-nav-text {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-nav-text .material-symbols-rounded {
    font-size: 20px;
}

/* ============================================
   ANCIEN HEADER (masqué)
   ============================================ */
.app-header {
    display: none;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-header {
    display: none;
}

/* Ancien nav-tabs (backup) */
.nav-tabs {
    display: none;
}

/* ============================================
   BOUTON RETOUR (Onglet Infos)
   ============================================ */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-back:hover {
    color: var(--text-dark);
}

.btn-back .material-symbols-rounded {
    font-size: 20px;
}

/* ============================================
   SECTIONS COLLAPSIBLES (Onglet Infos)
   ============================================ */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title.collapsible {
    cursor: pointer;
    user-select: none;
}

.section-title .collapse-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: transform var(--transition-fast);
}

.section-title .collapse-arrow .material-symbols-rounded {
    font-size: 20px;
    transition: transform var(--transition-fast);
}

.section-collapsible.collapsed .section-title .collapse-arrow .material-symbols-rounded {
    transform: rotate(-90deg);
}

.section-collapsible.collapsed .section-content {
    display: none;
}

/* Sélecteur type d'EDL et Meublé */
.edl-type-selector {
    display: flex;
    gap: 1rem;
}

.edl-type-option {
    flex: 1;
    cursor: pointer;
}

.edl-type-option input {
    display: none;
}

.edl-type-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 85px;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-fast);
    border: 3px solid transparent;
}

.edl-type-icon {
    font-size: 1.75rem;
}

.edl-type-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Type EDL - Entrée */
.edl-type-option.entree .edl-type-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.edl-type-option.entree .edl-type-label {
    color: #166534;
}

/* Type EDL - Sortie */
.edl-type-option.sortie .edl-type-box {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.edl-type-option.sortie .edl-type-label {
    color: #991b1b;
}

/* Meublé - Non meublé */
.edl-type-option.non-meuble .edl-type-box {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.edl-type-option.non-meuble .edl-type-label {
    color: #475569;
}

/* Meublé - Meublé */
.edl-type-option.meuble .edl-type-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.edl-type-option.meuble .edl-type-label {
    color: #92400e;
}

/* État sélectionné */
.edl-type-option input:checked + .edl-type-box {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

/* Hover */
.edl-type-option:hover .edl-type-box {
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
}

.edl-type-option input:checked + .edl-type-box:hover {
    transform: scale(1.03);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 1rem;
}

/* Quand les onglets sont visibles - conteneur blanc avec coins arrondis */
body.edl-active .container {
    background: var(--bg-white);
    border-radius: 24px 24px 0 0;
    min-height: calc(100vh - 4.5rem);
    margin-top: 5rem;
    padding: 1.5rem 1rem 6rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   TAB CONTENT - TRANSITIONS FLUIDES
   ============================================ */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: tabSlideIn 0.35s ease-out;
}

/* Animation d'entrée - glissement depuis la droite */
@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation de sortie - pour usage futur avec JS */
.tab-content.exiting {
    animation: tabSlideOut 0.25s ease-in forwards;
}

@keyframes tabSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Animation spéciale pour navigation arrière */
.tab-content.active.from-right {
    animation: tabSlideInFromLeft 0.35s ease-out;
}

@keyframes tabSlideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-green {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    color: white;
    border-radius: 30px;
}
.btn-green:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-green:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 30px;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--border-dark);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-light);
}

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

.btn-add {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem auto;
    width: fit-content;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add-small {
    background: var(--bg-gray);
    color: var(--primary);
    border: 1px dashed var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 0.75rem;
}

.btn-add-small:hover {
    background: var(--primary);
    color: white;
    border-style: solid;
}

.btn-clear {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-clear:hover {
    background: var(--danger);
    color: white;
}

.btn-photo {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-photo:hover {
    background: var(--info);
    color: white;
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.btn-delete:hover {
    background: var(--danger-bg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--bg-gray);
    cursor: not-allowed;
}

input[readonly],
select[readonly],
textarea[readonly] {
    background: var(--bg-gray);
}

/* Champs éditables en mode création */
input.editable,
select.editable,
textarea.editable {
    background: var(--bg-white);
    border-color: var(--border-dark);
    /*box-shadow: inset 0 0 0 1px var(--primary-light);*/
}

input.editable:focus,
select.editable:focus,
textarea.editable:focus {
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15), inset 0 0 0 1px var(--primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

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

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   SEARCH CONTAINER
   ============================================ */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-container input {
    padding-left: 2.75rem;
    font-size: 1.0625rem;
}

input#searchLogement {
    padding: 0px;
    background: none;
    border: none;
    padding-left: 20px;
}

input#searchLogement:focus {
    box-shadow: none;
}
.search-container::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-size: contain;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-gray);
}

.result-address {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.result-meta {
    font-size: 0.8125rem;
    color: var(--text-gray);
}

.no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-gray);
}

/* ============================================
   INFO BOXES
   ============================================ */
.info-box {
    background: var(--info-bg);
    border: 1px solid var(--info);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--primary-dark);
}

.info-box-warning {
    background: var(--warning-bg);
    border-color: var(--warning);
}

.info-box-success {
    background: var(--success-bg);
    border-color: var(--success);
}

.info-box-important {
    background: var(--conseil);
    border: 2px solid var(--conseil);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box-important h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.0625rem;
    display: flex;
    gap: 0.375rem;
}

.info-box-important ul {
    list-style: none;
    padding-left: 0;
}

.info-box-important li {
    padding: 0.375rem 0;
    color: var(--text-dark);
    font-size: 0.9375rem;
}

/* Info box avec image à droite */
.info-box-with-image {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.info-box-with-image .info-box-content {
    flex: 1;
}

.info-box-with-image .info-box-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-box-with-image .info-box-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 600px) {
    .info-box-with-image {
        flex-direction: column;
    }

    .info-box-with-image .info-box-image {
        width: 80px;
        height: 80px;
        order: -1;
    }
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.collapsible {
    margin-bottom: 1rem;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.collapsible-header:hover {
    background: var(--bg-gray);
    border-color: var(--border-dark);
}

.collapsible-header.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.collapsible-header h3,
.collapsible-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-header.active .collapse-icon .material-symbols-rounded {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow) ease;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.collapsible-content.active {
    max-height: 5000px;
}

.collapsible-content-inner {
    padding: 1.25rem;
}

/* ============================================
   PIECE CARDS
   ============================================ */
.piece-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.piece-card:hover {
    box-shadow: var(--shadow);
}

.piece-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-light) 100%);
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}

.piece-header h3 {
    color: var(--text-dark);
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.piece-header .btn-delete {
    color: rgba(255, 255, 255, 0.8);
}

.piece-header .btn-delete:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.piece-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow) ease;
}

.piece-content.active {
    max-height: 10000px;
}

.piece-content-inner {
    padding: 1.25rem;
}

/* Murs section */
.murs-section,
.elements-section,
.inventaire-section,
.media-360-section {
    margin-bottom: 1.5rem;
}

.murs-section h4,
.elements-section h4,
.inventaire-section h4,
.media-360-section h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--info-bg);
}

.murs-container,
.elements-container,
.equipements-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.elements-container .text-gray,
.equipements-container .text-gray {
    grid-column: 1 / -1;
}

.mur-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    position: relative;
}

.mur-item h5 {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
}

.mur-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

/* Bouton de suppression en haut à droite */
.btn-delete-corner {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-bg);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    color: var(--danger);
    z-index: 1;
}

.btn-delete-corner:hover {
    background: var(--danger);
    color: white;
}

/* Sélecteur d'état avec emojis */
.etat-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.etat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-gray);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 70px;
    flex: 1;
}

.etat-btn:hover {
    background: var(--bg-light);
    border-color: var(--border-dark);
}

.etat-btn.active {
    background: var(--primary-dark);
    border-color: var(--primary);
    color: white;
}

.etat-btn.active .etat-label {
    color: white;
}

.etat-emoji {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
    filter: grayscale(100%);
    transition: filter var(--transition-fast);
}

.etat-btn:hover .etat-emoji,
.etat-btn.active .etat-emoji {
    filter: grayscale(0%);
}

.etat-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-align: center;
    line-height: 1.2;
}

/* Pied d'élément (photo + observations) */
.element-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-photo-full {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-gray);
    border: 1px dashed var(--border-dark);
    border-radius: var(--border-radius);
    color: var(--text-gray);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-photo-full:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

.observations-inline {
    margin: 0;
}

.observations-inline label {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

/* Elements et Equipements */
.element-item,
.equipement-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    position: relative;
}

.element-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-right: 2.5rem;
}

.element-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    /*background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);*/
    color: var(--primary-dark);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.element-name-input {
    flex: 1;
    min-width: 150px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-dark);
    background: var(--bg-light);
    transition: all var(--transition-fast);
}

.element-name-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.element-name-input::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.element-type-select {
    font-weight: 500;
    font-size: 0.9375rem;
    border: none;
    background: transparent;
    padding: 0;
    color: var(--text-dark);
    cursor: pointer;
}

.element-type-select:focus {
    outline: none;
    color: var(--primary);
}

.element-item-content,
.equipement-item-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

/* ============================================
   COMPTEUR CARDS
   ============================================ */
.compteur-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.compteur-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    cursor: pointer;
}

.compteur-header h3 {
    color: white;
    margin: 0;
    font-size: 1rem;
}

.compteur-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow) ease;
    padding: 0 1.25rem;
}

.compteur-content.active {
    max-height: 5000px;
    padding: 1.25rem;
}

.compteur-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ============================================
   CLES (KEYS) CARDS
   ============================================ */
.cle-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
    cursor: pointer;
}

.cle-header h3 {
    color: white;
    margin: 0;
    font-size: 1rem;
}

.cle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow) ease;
    padding: 0 1.25rem;
}

.cle-content.active {
    max-height: 5000px;
    padding: 1.25rem;
}

.cle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Verifications section */
.verifications {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.verifications h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.verification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.verification-item:last-child {
    border-bottom: none;
}

.verification-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
}

.verification-item label {
    font-size: 0.9375rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Photos trousseau */
.photos-trousseau {
    margin-top: 1.5rem;
}

.photos-trousseau h4 {
    margin-bottom: 1rem;
}

.trousseau-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ============================================
   PHOTO UPLOADS & PREVIEWS
   ============================================ */
.photo-upload-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-gray);
}

.photo-upload-zone:hover {
    border-color: var(--primary);
    background: var(--bg-white);
}

.photo-upload-zone.dragover {
    border-color: var(--success);
    background: var(--success-bg);
}

.photo-upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.photo-upload-zone-text {
    font-size: 0.9375rem;
    color: var(--text-gray);
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.photo-preview-item:hover .remove-photo {
    opacity: 1;
}

/* Photo identité sections */
.photo-identite-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.photo-identite-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* ============================================
   SIGNATURE CANVAS
   ============================================ */
.signature-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.signature-container h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.signature-pad {
    display: block;
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-dark);
    border-radius: var(--border-radius);
    background: var(--bg-gray);
    cursor: crosshair;
    touch-action: none;
}

.signature-pad:hover {
    border-color: var(--primary);
}

.signature-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ============================================
   BOTTOM NAVIGATION (ancien - masqué)
   ============================================ */
.bottom-nav {
    display: none;
}

/* ============================================
   TOASTS
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform var(--transition);
    border-left: 4px solid var(--info);
}

.toast.show {
    transform: translateX(0);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-dark);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-dark);
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: var(--z-modal);
}

.loading-text {
    font-size: 1rem;
    color: var(--text-gray);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   POPUP ELEMENT TYPE SELECTOR
   ============================================ */
.popup-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: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition);
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.element-type-popup {
    width: 500px;
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.popup-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-dark);
}

.popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-gray);
    transition: all var(--transition-fast);
}

.popup-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.popup-subtitle {
    padding: 1rem 1.25rem 0.5rem;
    margin: 0;
    color: var(--text-gray);
    font-size: 0.875rem;
}

.element-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
}

.element-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: var(--bg-gray);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.element-type-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.element-type-btn:active {
    transform: translateY(0);
}

.element-type-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.element-type-label {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-align: center;
    font-weight: 500;
}

/* ============================================
   POPUP ÉQUIPEMENT TYPE SELECTOR
   ============================================ */
.equipement-type-popup {
    width: 600px;
    max-height: 85vh;
}

.equipement-categories-container {
    padding: 0.5rem 1.25rem 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.equipement-category {
    margin-bottom: 1rem;
}

.equipement-category:last-child {
    margin-bottom: 0;
}

.equipement-category-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.equipement-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.equipement-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem 0.375rem;
    background: var(--bg-gray);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.equipement-type-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.equipement-type-btn:active {
    transform: translateY(0);
}

.equipement-type-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.equipement-type-label {
    font-size: 0.6875rem;
    color: var(--text-dark);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* ============================================
   ÉQUIPEMENT ITEM DETAILS
   ============================================ */
.equipement-details-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.equipement-quantity {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.equipement-quantity label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
}

.quantity-input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    text-align: center;
}

.equipement-marque {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.equipement-marque label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    white-space: nowrap;
}

.marque-input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .element-type-popup,
    .piece-type-popup {
        width: 95%;
    }

    .equipement-type-popup {
        width: 95%;
    }

    .equipement-type-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .equipement-details-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .equipement-quantity,
    .equipement-marque {
        width: 100%;
    }

    .element-type-grid,
    .piece-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Popup de sélection de type de pièce */
.piece-type-popup {
    width: 550px;
    max-height: 85vh;
}

.piece-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.piece-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 0.5rem;
    background: var(--bg-gray);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.piece-type-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.piece-type-btn:active {
    transform: translateY(0);
}

.piece-type-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.piece-type-label {
    font-size: 0.6875rem;
    color: var(--text-dark);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .piece-type-popup {
        width: 95%;
    }

    .piece-type-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 400px) {
    .piece-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   LOCATAIRE CARDS
   ============================================ */
.locataire-card {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.locataire-card h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.locataire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

/* ============================================
   SECTION TOGGLES
   ============================================ */
.section-toggle {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.section-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.section-toggle-header:hover {
    background: var(--bg-gray);
}

.section-toggle-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.section-toggle-content.active {
    max-height: 3000px;
}

.section-toggle-content-inner {
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-gray);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.empty-state-text {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: var(--bg-gray);
    color: var(--text-gray);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.warning-text {
    color: var(--warning);
    font-size: 0.875rem;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
}

.success-text {
    color: var(--success);
    font-size: 0.875rem;
}

/* ============================================
   RÉCAPITULATIF DÉTAILLÉ (Onglet Signatures)
   ============================================ */

/* En-tête du récapitulatif */
.recap-header {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-dark);
}

.recap-header-sortie {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
}

.recap-header-entree {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);;
}

.recap-main-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recap-date {
    font-size: 0.8125rem;
    opacity: 0.9;
}

/* Sections */
.recap-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
}

.recap-section:last-child {
    margin-bottom: 0;
}

.recap-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recap-title-icon {
    font-size: 1.125rem;
}

.recap-content {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Sous-sections */
.recap-subsection {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary);
}

.recap-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Lignes */
.recap-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    gap: 0.75rem;
}

.recap-row-indent {
    padding-left: 1rem;
}

.recap-label {
    color: var(--text-gray);
    flex-shrink: 0;
    min-width: 90px;
}

.recap-value {
    color: var(--text-dark);
    text-align: right;
    word-break: break-word;
}

.recap-empty {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Badges */
.recap-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.recap-badge.entree {
    background: var(--success-bg);
    color: var(--success);
}

.recap-badge.sortie {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== PIÈCES DÉTAILLÉES ===== */
.recap-piece-block {
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.recap-piece-block:last-child {
    margin-bottom: 0;
}

.recap-piece-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.recap-piece-icon-large {
    font-size: 1.5rem;
}

.recap-piece-name-large {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    flex: 1;
}

.recap-etat-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-weight: 600;
}

.recap-etat-neuf {
    background: #dcfce7;
    color: #15803d;
}

.recap-etat-bon {
    background: #dbeafe;
    color: #1d4ed8;
}

.recap-etat-moyen {
    background: #fef3c7;
    color: #b45309;
}

.recap-etat-mauvais {
    background: #fee2e2;
    color: #b91c1c;
}

/* Groupes d'éléments dans une pièce */
.recap-element-group {
    margin-bottom: 0.75rem;
}

.recap-element-group:last-child {
    margin-bottom: 0;
}

.recap-element-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

/* Grille des items (murs, éléments, équipements) */
.recap-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.recap-item {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    border-left: 3px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.recap-item-neuf { border-left-color: #22c55e; }
.recap-item-bon { border-left-color: #3b82f6; }
.recap-item-moyen { border-left-color: #f59e0b; }
.recap-item-mauvais { border-left-color: #ef4444; }

.recap-item-name {
    font-weight: 600;
    color: var(--text-dark);
}

.recap-item-marque {
    font-size: 0.6875rem;
    color: var(--text-light);
}

.recap-item-etat {
    font-size: 0.6875rem;
    color: var(--text-gray);
}

.recap-item-obs {
    font-size: 0.6875rem;
    color: var(--warning);
    font-style: italic;
    margin-top: 0.125rem;
}

.recap-item-photo {
    font-size: 0.625rem;
    color: var(--info);
}

/* Observations de la pièce */
.recap-piece-observations {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--warning-bg);
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    color: var(--warning-dark, #92400e);
}

/* Médias 360° */
.recap-piece-media {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.recap-media-badge {
    font-size: 0.6875rem;
    background: var(--info-bg);
    color: var(--info);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

/* ===== COMPTEURS ===== */
.recap-compteurs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.recap-compteur-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.recap-compteur-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--primary);
    color: white;
}

.recap-compteur-icon {
    font-size: 1.125rem;
}

.recap-compteur-type {
    font-weight: 600;
    font-size: 0.875rem;
}

.recap-compteur-body {
    padding: 0.625rem 0.75rem;
}

.recap-row-sm {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 0.125rem 0;
}

.recap-label-sm {
    color: var(--text-light);
}

.recap-value-sm {
    color: var(--text-dark);
    font-weight: 500;
}

.recap-compteur-index {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recap-index-label {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.recap-index-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.recap-compteur-obs {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--text-gray);
    font-style: italic;
}

.recap-compteur-photo {
    padding: 0.375rem 0.75rem;
    background: var(--info-bg);
    font-size: 0.6875rem;
    color: var(--info);
    text-align: center;
}

/* ===== CLÉS ===== */
.recap-cles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.625rem;
}

.recap-cle-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.recap-cle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border);
}

.recap-cle-num {
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text-dark);
}

.recap-cle-statut {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.recap-statut-remis {
    background: var(--success-bg);
    color: var(--success);
}

.recap-statut-non_remis {
    background: var(--danger-bg);
    color: var(--danger);
}

.recap-statut-perdu {
    background: var(--warning-bg);
    color: var(--warning);
}

.recap-statut-a_refaire {
    background: var(--info-bg);
    color: var(--info);
}

.recap-cle-body {
    padding: 0.5rem 0.75rem;
}

.recap-cle-obs {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--text-gray);
    font-style: italic;
}

.recap-cles-verifications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.recap-verif {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-weight: 500;
}

.recap-verif-ok {
    background: var(--success-bg);
    color: var(--success);
}

.recap-verif-no {
    background: var(--bg-gray);
    color: var(--text-light);
}

.recap-cles-commentaires {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    color: var(--text-gray);
}

/* ===== IDENTITÉ ===== */
.recap-identite-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recap-identite-obs {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-gray);
}

/* ===== STATISTIQUES GLOBALES ===== */
.recap-stats {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gray) 100%);
}

.recap-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.recap-stat-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.recap-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.recap-stat-label {
    font-size: 0.6875rem;
    color: var(--text-gray);
    display: block;
    margin-top: 0.125rem;
}

/* Barres de répartition des états */
.recap-etats-summary {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    border: 1px solid var(--border);
}

.recap-etats-summary h5 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
}

.recap-etats-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recap-etat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.recap-etat-bar-label {
    width: 70px;
    flex-shrink: 0;
    color: var(--text-gray);
}

.recap-etat-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
}

.recap-etat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.recap-etat-bar-value {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.6875rem;
}

/* Locataire item */
.recap-locataire-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
}

.recap-locataire-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --container-max: 100%;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --nav-height: 48px;
        --footer-height: 80px;
    }

    html {
        font-size: 15px;
    }

    .logo {
        font-size: 1rem;
    }

    .btn-header span {
        display: none;
    }

    .container {
        padding: 0.75rem;
    }

    body.edl-active .container {
        margin-top: 4.8rem;
        min-height: calc(100vh - 4.8rem);
        padding: 1.25rem 0.75rem 5.5rem;
        border-radius: 20px 20px 0 0;
    }

    .card {
        padding: 1rem;
        border-radius: var(--border-radius);
    }

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

    .murs-container,
    .equipements-container {
        grid-template-columns: 1fr;
    }

    .compteur-grid,
    .cle-grid,
    .locataire-grid {
        grid-template-columns: 1fr;
    }

    /* Navigation flottante responsive */
    .nav-tabs-floating {
        top: 0.75rem;
        padding: 0.2rem;
    }

    .nav-slider {
        top: 0.2rem;
        left: 0.2rem;
        height: calc(100% - 0.4rem);
    }

    .nav-tabs-floating button {
        padding: 0.4rem 0.45rem;
        font-size: 0.75rem;
    }

    .nav-tabs-floating button.active {
        padding: 0.4rem 0.75rem;
    }

    .nav-tabs-floating button .tab-icon {
        font-size: 1.2rem;
        width: 1.2rem;
    }

    .nav-tabs-floating button.active .tab-text {
        max-width: 100px;
    }

    .bottom-nav-floating {
        bottom: 1rem;
    }

    .btn-fab {
        bottom: 5.5rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }

    .btn-fab .material-symbols-rounded {
        font-size: 24px;
    }

    .btn-nav {
        padding: 1.1rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-add-small {
        width: 100%;
        justify-content: center;
    }

    .signature-pad {
        height: 150px;
    }

    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .modal {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .element-item,
    .equipement-item {
        grid-template-columns: 1fr;
    }

    .photo-upload-zone {
        padding: 1.5rem 1rem;
    }

    .info-box-important {
        padding: 1rem;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }

    .nav-tabs button {
        padding: 0.5rem 0.5rem;
    }

    .btn-add {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }
}

/* ============================================
   PAGE DE FINALISATION
   ============================================ */
.finalize-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.finalize-page.hidden {
    display: none;
}

.finalize-container {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    padding: 2.5rem;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.finalize-header {
    margin-bottom: 2rem;
}

.finalize-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }
}

.finalize-icon .material-symbols-rounded {
    font-size: 48px;
    color: white;
}

.finalize-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.finalize-subtitle {
    color: var(--text-gray);
    font-size: 0.9375rem;
}

.finalize-info {
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}

.finalize-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.finalize-info .info-row:last-child {
    border-bottom: none;
}

.finalize-info .info-label {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.finalize-info .info-value {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.875rem;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.finalize-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.finalize-actions .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.finalize-actions .btn .material-symbols-rounded {
    font-size: 24px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--border-radius-lg);
}

.finalize-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.finalize-footer .btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.9375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.finalize-footer .btn-text:hover {
    color: var(--primary-dark);
}

.finalize-footer .btn-text .material-symbols-rounded {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .finalize-container {
        padding: 1.5rem;
    }

    .finalize-header h1 {
        font-size: 1.5rem;
    }

    .finalize-icon {
        width: 64px;
        height: 64px;
    }

    .finalize-icon .material-symbols-rounded {
        font-size: 36px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .app-header,
    .nav-tabs,
    .bottom-nav,
    .btn-delete,
    .btn-add,
    .btn-add-small,
    .toast-container {
        display: none !important;
    }

    body {
        background: white;
        padding: 0;
    }

    .container {
        padding: 0;
        max-width: none;
    }

    .tab-content {
        display: block !important;
    }

    .collapsible-content,
    .piece-content,
    .section-toggle-content {
        max-height: none !important;
    }

    .card,
    .piece-card,
    .compteur-card,
    .cle-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ============================================
   LIGHTBOX - VISUALISATION IMAGES
   ============================================ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-title {
    color: white;
    margin-top: 1rem;
    font-size: 1rem;
    text-align: center;
}

/* ============================================
   MINIATURES INLINE
   ============================================ */
.thumbnail-preview {
    display: inline-flex;
    position: relative;
    border-radius: 6px;
    overflow: visible;
    border: 2px solid var(--border-color);
    background: var(--gray-100);
    vertical-align: middle;
    margin-left: 0.5rem;
    margin-top: 8px;
    margin-right: 8px;
}

.thumbnail-preview img {
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.thumbnail-preview img.clickable {
    cursor: zoom-in;
}

.thumbnail-preview img.clickable:hover {
    opacity: 0.9;
}

.thumbnail-small {
    width: 40px;
    height: 40px;
}

.thumbnail-small img {
    width: 40px;
    height: 40px;
}

.thumbnail-medium {
    width: 60px;
    height: 60px;
}

.thumbnail-medium img {
    width: 60px;
    height: 60px;
}

.thumbnail-large {
    width: 100px;
    height: 100px;
}

.thumbnail-large img {
    width: 100px;
    height: 100px;
}

.thumbnail-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px var(--danger);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.thumbnail-remove:hover {
    background: #c53030;
    transform: scale(1.15);
}

/* Container pour bouton + miniature inline */
.photo-button-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.photo-button-container .btn {
    flex-shrink: 0;
}

.thumbnails-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

/* Photo preview amélioré avec agrandissement */
.photo-preview-item {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.photo-preview-item img {
    display: block;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.photo-preview-item img:hover {
    transform: scale(1.02);
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-preview-item:hover .remove-photo {
    opacity: 1;
}

/* Grille de photos pour affichage multiple */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.photos-grid .photo-preview-item img {
    width: 100%;
    height: 80px;
}

/* Grande preview pour pièces et identité */
.photo-preview-large {
    margin-top: 0.75rem;
}

.photo-preview-large .photo-preview-item img {
    width: 150px;
    height: 150px;
}

@media (max-width: 768px) {
    .photo-preview-large .photo-preview-item img {
        width: 120px;
        height: 120px;
    }

    .thumbnail-large {
        width: 80px;
        height: 80px;
    }

    .thumbnail-large img {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --border-dark: #000;
        --text-gray: #333;
    }
}

/* ============================================
   DARK MODE (Optional - préparé pour future)
   ============================================ */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1e293b;
        --bg-white: #0f172a;
        --bg-gray: #1e293b;
        --text-dark: #f8fafc;
        --text-gray: #94a3b8;
        --text-light: #64748b;
        --border: #334155;
        --border-dark: #475569;
    }
}
*/

/* ============================================
   LISTE DES EDL LOCAUX
   ============================================ */
.edl-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.edl-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.edl-item:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.edl-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.edl-item-icon.entree {
    background: var(--success);
}

.edl-item-icon.sortie {
    background: var(--danger);
}

.edl-item-content {
    flex: 1;
    min-width: 0;
}

.edl-item-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edl-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edl-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.edl-item-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.edl-item-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
    text-transform: uppercase;
}

.edl-item-status.brouillon {
    background: var(--warning-bg);
    color: var(--warning);
}

.edl-item-status.en_cours {
    background: var(--info-bg);
    color: var(--info);
}

.edl-item-status.termine {
    background: var(--success-bg);
    color: var(--success);
}

.edl-item-status.signe {
    background: #c4f1f9;
    color: #0891b2;
}

.edl-item-actions {
    display: flex;
    gap: 0.5rem;
}

.edl-item-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.edl-item-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary);
}

.edl-item-btn.delete:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Badge count dans le header */
.card-header .badge {
    background: var(--primary);
    color: white;
    min-width: 24px;
    text-align: center;
}
