/* ==========================================================================
   Services Techniques - Mairie de Pécy - System Design & Styling
   Harmonisé avec l'Espace Communication (com-mairiepecy.pages.dev)
   ========================================================================== */

/* Variables & Design Tokens */
:root {
    /* Color Palette */
    --primary: #1e3a8a;          /* Bleu Institutionnel Pécy */
    --primary-light: #3b82f6;    /* Bleu Accent */
    --primary-hover: #172554;
    --primary-subtle: #eff6ff;
    
    --secondary: #64748b;        /* Slate */
    --secondary-light: #f1f5f9;
    
    --success: #10b981;          /* Émeraude */
    --success-light: #d1fae5;
    --success-dark: #065f46;
    
    --danger: #ef4444;           /* Rouge Vif */
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;
    
    --warning: #f59e0b;          /* Ambre / Incivilité */
    --warning-light: #fef3c7;
    --warning-dark: #92400e;

    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    /* Backgrounds & Text */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;        /* Slate 800 */
    --text-muted: #64748b;       /* Slate 500 */
    --text-light: #94a3b8;
    
    /* Structure & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 20px 25px -5px rgba(30, 58, 138, 0.06), 0 8px 10px -6px rgba(30, 58, 138, 0.04);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1250px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.25rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .app-container {
        padding: 2rem 1.5rem;
        gap: 1.75rem;
    }
}

/* ==========================================================================
   HEADER PRINCIPAL
   ========================================================================== */
.main-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

@media (min-width: 840px) {
    .main-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 2rem;
    }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon-wrapper {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    flex-shrink: 0;
}

.logo-emoji {
    font-size: 1.6rem;
    line-height: 1;
}

.header-titles h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header-badge-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.commune-badge {
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
}

.header-status-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-status-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #059669;
}

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

.btn-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-header-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-header-action svg {
    width: 0.95rem;
    height: 0.95rem;
    color: #64748b;
}

.btn-header-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-header-logout svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* ==========================================================================
   NAVIGATION PAR ONGLETS (TYPE APPLICATION NATIVE)
   ========================================================================== */
.nav-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 1.15rem;
    border: 1px solid #e2e8f0;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.65rem 0.35rem;
    background: transparent;
    border: none;
    border-radius: 0.85rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:active {
    transform: scale(0.96);
}

.tab-btn:hover {
    color: #0f172a;
}

.tab-btn.active {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.tab-btn-label {
    letter-spacing: -0.01em;
}

.tab-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.tab-badge-pulse {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
}

.tab-btn.active .tab-badge-pulse {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.tab-counter {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--secondary-light);
    color: var(--secondary);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}

.tab-btn.active .tab-counter {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.tab-counter.alert {
    background: #fee2e2;
    color: #ef4444;
}

/* Contenu des onglets */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARTES & STRUCTURE
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card {
        padding: 2rem;
    }
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
    .card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.card-title-group h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-title-group p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.timestamp-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--secondary-light);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 600;
    align-self: flex-start;
}

.small-icon {
    width: 0.9rem;
    height: 0.9rem;
}

/* ==========================================================================
   FORMULAIRE DE SAISIE RAPIDE V2 (TERRAIN / IPAD / IPHONE 16)
   ========================================================================== */
.card-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-main-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.form-grid-clean {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-inline-add {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.5rem;
}

.btn-inline-add:hover {
    background: #eff6ff;
}

.btn-inline-add svg {
    width: 0.85rem;
    height: 0.85rem;
}

/* Raccourcis de saisie rapide (Compact & Minimal) */
.shortcuts-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-add-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-add-shortcut:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.btn-add-shortcut:active {
    transform: scale(0.97);
}

.shortcuts-chips-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

/* 2. Zone Photo Compacte */
.photo-compact-uploader {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.btn-compact-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.25rem;
    background: #f0f7ff;
    border: 2px dashed #93c5fd;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}

.btn-compact-photo:hover {
    background: #e0f2fe;
    border-color: #2563eb;
}

.btn-compact-photo:active {
    transform: scale(0.98);
}

.photo-btn-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.photo-btn-text {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e40af;
}

.photo-btn-tag {
    font-size: 0.68rem;
    font-weight: 800;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.photo-badge-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
}

/* 2. SÉLECTEUR DE LIEU MODERNE EN PILULE (ARRONDI, FUN, IPAD/SMARTPHONE/PC) */
.pill-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pill-select-icon {
    position: absolute;
    left: 1.15rem;
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

.pill-select-input {
    width: 100%;
    height: 54px;
    padding: 0 2.75rem 0 3rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #cbd5e1;
    border-radius: 9999px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
}

.pill-select-input:hover {
    border-color: #94a3b8;
    background: #ffffff;
}

.pill-select-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.pill-select-chevron {
    position: absolute;
    right: 1.2rem;
    pointer-events: none;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-select-chevron svg {
    width: 1.15rem;
    height: 1.15rem;
}

.btn-pill-add {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #1d4ed8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pill-add:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.btn-pill-add svg {
    width: 0.85rem;
    height: 0.85rem;
}

/* 3. CATÉGORIES EN PILULES TACTILES & COLORÉES (ZÉRO DROPDOWN 2005) */
.category-pills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

@media (min-width: 850px) {
    .category-pills-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-pill-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.95rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.category-pill-btn:active {
    transform: scale(0.96);
}

.category-pill-btn .pill-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.category-pill-btn .pill-text-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-pill-btn .pill-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.category-pill-btn .pill-subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Thèmes actifs par catégorie */
.category-pill-btn[data-cat="proprete"].active {
    background: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}
.category-pill-btn[data-cat="proprete"].active .pill-title { color: #92400e; }
.category-pill-btn[data-cat="proprete"].active .pill-subtitle { color: #b45309; }

.category-pill-btn[data-cat="espaces_verts"].active {
    background: #ecfdf5;
    border-color: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}
.category-pill-btn[data-cat="espaces_verts"].active .pill-title { color: #065f46; }
.category-pill-btn[data-cat="espaces_verts"].active .pill-subtitle { color: #047857; }

.category-pill-btn[data-cat="batiment"].active {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2);
}
.category-pill-btn[data-cat="batiment"].active .pill-title { color: #1e40af; }
.category-pill-btn[data-cat="batiment"].active .pill-subtitle { color: #2563eb; }

.category-pill-btn[data-cat="securite"].active {
    background: #fff1f2;
    border-color: #f43f5e;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.2);
}
.category-pill-btn[data-cat="securite"].active .pill-title { color: #9f1239; }
.category-pill-btn[data-cat="securite"].active .pill-subtitle { color: #be123c; }

/* 4. CONTRÔLE SEGMENTÉ MODERNE POUR L'ÉTAT (STYLE IOS PILL) */
.segmented-control-modern {
    display: flex;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    padding: 4px;
    gap: 4px;
    min-height: 54px;
}

.segment-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border-radius: 9999px;
    background: transparent;
    border: 1.5px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.segment-btn:active {
    transform: scale(0.96);
}

.segment-btn .seg-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* États actifs segmentés */
.segment-btn[data-status="nettoye_fait"].active {
    background: #ffffff;
    color: #065f46;
    border-color: #a7f3d0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.22);
}

.segment-btn[data-status="constate_attente"].active {
    background: #ffffff;
    color: #92400e;
    border-color: #fde68a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.22);
}

.segment-btn[data-status="urgent_danger"].active {
    background: #ffffff;
    color: #9f1239;
    border-color: #fecdd3;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.22);
}

/* BADGE CERTIFIÉ INFALSIFIABLE (JOURNAL DE TRAÇABILITÉ) */
.badge-certified {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #15803d;
}

.badge-certified svg {
    color: #16a34a;
}

/* 5. Statut & Switch iOS */
.form-row-duo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.form-field-half {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.select-clean {
    width: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 1.25rem;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    cursor: pointer;
    min-height: 54px;
}

.select-clean:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ios-switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-radius: 1.25rem;
    border: 2px solid #e2e8f0;
    min-height: 54px;
}

.ios-switch-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ios-switch-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.ios-switch-title {
    font-weight: 800;
    font-size: 0.88rem;
    color: #0f172a;
}

.ios-switch-sub {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s;
    border-radius: 34px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ios-switch input:checked + .ios-slider {
    background-color: #10b981;
}

.ios-switch input:checked + .ios-slider:before {
    transform: translateX(20px);
}

/* 6. Grand bouton d'action V2 */
.form-actions-v2 {
    padding-top: 0.5rem;
}

.btn-submit-gradient {
    width: 100%;
    padding: 1.15rem 1.5rem;
    border: none;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #4338ca 100%);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-submit-gradient:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-submit-emoji {
    font-size: 1.35rem;
    line-height: 1;
}

/* Legacy support */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
}

.col-span-12 { grid-column: span 12; }
.col-span-6 { grid-column: span 12; }

@media (min-width: 768px) {
    .col-span-6 { grid-column: span 6; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label-highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge-info {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--secondary-light);
    color: var(--secondary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.required {
    color: var(--danger);
}

/* Zone de largage / clic photo */
.photo-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.75rem 1rem;
    text-align: center;
    background: #fdfdfd;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.photo-dropzone:hover, .photo-dropzone.dragover {
    border-color: var(--primary-light);
    background: var(--primary-subtle);
}

.drop-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary-light);
}

.drop-text {
    font-size: 0.9rem;
    color: var(--text-main);
}

.drop-text strong {
    color: var(--primary);
}

.drop-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hidden-file-input {
    display: none;
}

/* Galerie de photos sélectionnées */
.photos-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.photo-thumb-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: #000000;
}

.photo-thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-thumb {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border: none;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Boutons Chips pour les lieux de Pécy */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    background: var(--secondary-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.chip svg {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--secondary);
}

.chip:hover {
    border-color: #94a3b8;
}

.chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.chip.active svg {
    color: #ffffff;
}

/* Grille des catégories de constat */
.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.category-card input[type="radio"] {
    display: none;
}

.category-card:hover {
    border-color: #94a3b8;
}

.category-card.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.08);
}

.cat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-incivilite { background: #fef3c7; color: #d97706; }
.cat-batiment { background: #dbeafe; color: #2563eb; }
.cat-espaces { background: #d1fae5; color: #059669; }
.cat-securite { background: #ede9fe; color: #7c3aed; }

.cat-info {
    display: flex;
    flex-direction: column;
}

.cat-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-main);
}

.cat-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.25;
    margin-top: 0.15rem;
}

/* Dictée Vocale */
.label-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-voice {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-voice.listening {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    70% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.mic-icon {
    width: 0.95rem;
    height: 0.95rem;
}

/* Inputs, Textareas, Selects */
input[type="text"],
input[type="password"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: var(--transition);
}

@media (max-width: 768px) {
    /* Empêche le zoom automatique indésirable de Safari sur iPhone 16 */
    input[type="text"],
    input[type="password"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
    resize: vertical;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checkbox personnalisée */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 1.2rem;
    height: 1.2rem;
    border: 1.5px solid #94a3b8;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
    content: "✓";
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Boutons d'action */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-primary.btn-large {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    width: 100%;
}

.btn-secondary {
    background: var(--secondary-light);
    color: var(--secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-danger {
    background: #fee2e2;
    color: #ef4444;
}

.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-icon {
    width: 1.1rem;
    height: 1.1rem;
}

/* ==========================================================================
   ONGLET 2 : REGISTRE & PARAPLUIE (HISTORIQUE PAR MOIS)
   ========================================================================== */
.registre-header-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.registre-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    justify-content: space-between;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
    flex: 1;
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-item label svg {
    width: 0.85rem;
    height: 0.85rem;
}

.filter-actions {
    display: flex;
    align-items: center;
}

/* Statistiques & KPIs */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-card.alert-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.stat-icon-wrap {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bg-blue-soft { background: #dbeafe; color: #1e3a8a; }
.bg-amber-soft { background: #fef3c7; color: #b45309; }
.bg-emerald-soft { background: #d1fae5; color: #065f46; }
.bg-purple-soft { background: #ede9fe; color: #5b21b6; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-card.alert-warning .stat-number {
    color: #b45309;
}

.stat-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-top: 0.25rem;
}

.stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

/* Grille des constats du registre */
.registre-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.constat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

@media (min-width: 768px) {
    .constat-card {
        padding: 1.5rem;
    }
}

.constat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.constat-top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.constat-badge-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-tag {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.badge-tag.incivilite { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-tag.batiment { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-tag.espaces_verts { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-tag.securite { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }

.badge-recurrence {
    font-size: 0.725rem;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid #fecaca;
}

.constat-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    font-family: monospace;
}

.constat-location {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.constat-location svg {
    color: var(--primary);
    width: 1.1rem;
    height: 1.1rem;
}

.constat-text {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Grille de photos du constat */
.constat-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.constat-photo-item {
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0f172a;
    cursor: pointer;
    position: relative;
}

.constat-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.constat-photo-item:hover img {
    transform: scale(1.05);
}

.constat-photo-item .photo-zoom-hint {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.constat-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.status-indicator.done { color: var(--success); }
.status-indicator.pending { color: var(--warning-dark); }
.status-indicator.danger { color: var(--danger); }

/* ==========================================================================
   ONGLET 3 : DEMANDES D'ÉLUS (LE MODÈLE DU FRÈRE)
   ========================================================================== */
.demandes-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-banner-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border-color: #bfdbfe;
}

@media (min-width: 640px) {
    .info-banner-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.banner-content {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.banner-icon {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.banner-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.banner-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Grille Kanban */
.kanban-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 880px) {
    .kanban-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.kanban-column {
    background: #f1f5f9;
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 400px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

.col-title-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.column-header h4 {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text-main);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

.dot-todo { background: var(--warning); }
.dot-progress { background: var(--primary-light); }
.dot-done { background: var(--success); }

.header-todo { border-color: var(--warning); }
.header-progress { border-color: var(--primary-light); }
.header-done { border-color: var(--success); }

.col-badge {
    background: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    color: var(--secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kanban-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.demande-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
}

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

.demande-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.4rem;
}

.demande-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.badge-urgent {
    font-size: 0.65rem;
    font-weight: 800;
    background: #fee2e2;
    color: #ef4444;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.demande-card-lieu {
    font-size: 0.75rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.demande-card-lieu svg {
    width: 0.8rem;
    height: 0.8rem;
}

.demande-card-desc {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.4;
}

.demande-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.7rem;
    color: var(--text-light);
}

.demande-author {
    font-weight: 600;
    color: var(--text-muted);
}

.btn-status-action {
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.725rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-status-action.to-progress {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.btn-status-action.to-done {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   ONGLET 4 : TABLEAU & CARTES ENTREPRISES (RESPONSIVE IPHONE)
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
}

.desktop-only-table {
    display: block;
}

.mobile-only-cards {
    display: none;
}

/* Cartes Passages d'entreprises pour smartphone & iPhone (Zéro scroll horizontal) */
.entreprises-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-top: 0.5rem;
}

.entreprise-mobile-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.entreprise-mobile-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ent-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.65rem;
}

.ent-card-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.btn-ent-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.btn-ent-delete i, .btn-ent-delete svg {
    width: 15px;
    height: 15px;
}

.btn-ent-delete:active {
    transform: scale(0.92);
    background: #fee2e2;
}

.ent-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ent-card-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.ent-card-location {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
}

.ent-card-location i, .ent-card-location svg {
    width: 14px;
    height: 14px;
    color: #3b82f6;
}

.ent-card-motif {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.45;
}

.ent-motif-label {
    font-weight: 800;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}

.ent-motif-desc {
    color: #1e293b;
    font-weight: 500;
}

.ent-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding-top: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ent-contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.ent-contact-chip:hover {
    background: #d1fae5;
}

.ent-contact-chip i, .ent-contact-chip svg {
    width: 12px;
    height: 12px;
}

.ent-contact-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.ent-contact-text i, .ent-contact-text svg {
    width: 12px;
    height: 12px;
}

.ent-no-contact {
    color: #94a3b8;
    font-size: 0.78rem;
    font-style: italic;
}

.ent-author-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-left: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    text-align: left;
}

.data-table th {
    background: var(--secondary-light);
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #fdfdfd;
}

.badge-status-table {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
}

.badge-status-table.ok { background: #d1fae5; color: #065f46; }
.badge-status-table.planifie { background: #ede9fe; color: #5b21b6; }
.badge-status-table.urgent { background: #fee2e2; color: #991b1b; }

/* ==========================================================================
   GATE OVERLAY (VERROUILLAGE ACCÈS MUNICIPAL)
   ========================================================================== */
.gate-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.gate-overlay.hidden {
    display: none;
}

.gate-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
    max-width: 440px;
    width: 100%;
    padding: 2.25rem 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: zoomModal 0.25s ease-out;
}

.gate-icon-wrapper {
    width: 3.75rem;
    height: 3.75rem;
    margin: 0 auto 1.25rem auto;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.gate-icon-wrapper svg {
    width: 2rem;
    height: 2rem;
}

.gate-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.gate-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chip-remove-btn {
    margin-left: 0.35rem;
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}

.chip-remove-btn:hover {
    opacity: 1;
    color: var(--danger);
}

/* ==========================================================================
   MODALS & LIGHTBOX
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    animation: zoomModal 0.2s ease-out;
}

@keyframes zoomModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-intro {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* Lightbox pour photos en grand */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
}

.lightbox-overlay.hidden {
    display: none;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

.lightbox-caption {
    color: #ffffff;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    color: #cbd5e1;
}

/* Footer */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 1.5rem 0;
    margin-top: auto;
}

/* ==========================================================================
   JOURNAL DE TRAÇABILITÉ (AUDIT TRAIL VISUEL)
   ========================================================================== */
.audit-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.audit-entry-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.audit-entry-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.audit-entry-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audit-entry-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.audit-entry-icon.icon-constat { background: #dbeafe; color: #1e3a8a; }
.audit-entry-icon.icon-demande { background: #fef3c7; color: #b45309; }
.audit-entry-icon.icon-entreprise { background: #ede9fe; color: #6d28d9; }
.audit-entry-icon.icon-delete { background: #fee2e2; color: #b91c1c; }
.audit-entry-icon.icon-status { background: #d1fae5; color: #065f46; }

.audit-entry-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.audit-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audit-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: var(--secondary-light);
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.audit-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.audit-entry-desc {
    font-size: 0.825rem;
    color: var(--text-main);
    line-height: 1.4;
    font-weight: 500;
}

.audit-entry-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   HORODATAGE & MÉTADONNÉES DES PHOTOS (EXIF / LASTMODIFIED)
   ========================================================================== */
.photo-shot-tag {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.02em;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.photo-shot-tag svg {
    width: 0.7rem;
    height: 0.7rem;
    color: #fbbf24;
}

/* Bouton Renouveler ce relevé (Constats répétitifs) */
.btn-renew-constat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.725rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--primary);
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: var(--transition);
}

.btn-renew-constat:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Raccourcis personnalisés dynamiques (Christophe) */
.shortcut-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.shortcut-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.shortcut-chip svg {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--warning-dark);
}

.shortcut-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.5;
    padding: 0 2px;
}

.shortcut-remove-btn:hover {
    opacity: 1;
    color: var(--danger);
}

/* Badges indicateurs de notification e-mail Mairie */
.badge-notif {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.badge-notif svg {
    width: 0.75rem;
    height: 0.75rem;
}

.badge-notif-sent {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-notif-none {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   STYLE D'IMPRESSION (BILAN POUR LE CONSEIL MUNICIPAL)
   ========================================================================== */
@media print {
    body {
        background: #ffffff;
        color: #000000;
    }
    
    .app-container {
        padding: 0;
        gap: 1rem;
    }

    .main-header .header-actions,
    .nav-tabs,
    .filter-actions,
    .app-footer,
    .btn-status-action,
    #tab-terrain,
    #demande-modal {
        display: none !important;
    }

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

    .card, .constat-card {
        border: 1px solid #cccccc;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* ==========================================================================
   OPTIMISATIONS ERGONOMIQUES IPHONE 16 & IPAD MINI
   ========================================================================== */
@media (max-width: 768px) {
    /* Évite le zoom automatique perturbateur d'iOS WebKit quand on touche un champ */
    input, select, textarea, .select-clean, .textarea-clean {
        font-size: 16px !important;
    }
    
    .form-row-duo {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    
    .card {
        padding: 1rem;
    }

    /* Bascule Agenda sur iPhone : Cartes lisibles avec zéro défilement horizontal */
    .desktop-only-table {
        display: none !important;
    }

    .mobile-only-cards {
        display: flex !important;
    }
}

