/* ==========================================================================
   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;
}

/* Utilitaire universel d'affichage */
.hidden {
    display: none !important;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

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 {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 0.85rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    overflow-x: hidden;
}

@media (min-width: 640px) {
    .app-container {
        padding: 1.15rem 1rem;
        gap: 1.25rem;
    }
}

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

/* ==========================================================================
   HEADER PRINCIPAL
   ========================================================================== */
.main-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    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 {
        padding: 1.25rem 2rem;
    }
}

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

.logo-icon-wrapper {
    width: 2.75rem;
    height: 2.75rem;
    background: #1e3a8a;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.25);
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.header-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.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;
}

/* Bouton Roue Crantée ⚙️ Unique */
.btn-gear-settings {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius-full);
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-gear-settings:hover {
    background: #e2e8f0;
    color: var(--primary);
    border-color: #94a3b8;
    transform: rotate(25deg);
}

.btn-gear-settings:active {
    transform: scale(0.92);
}

.btn-gear-settings svg {
    width: 1.3rem;
    height: 1.3rem;
}

.gear-dot-active {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4);
}

/* Boîtes et listes dans le modal de réglages */
.settings-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.settings-box-header {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.settings-box-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.settings-box-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.settings-box-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

.settings-item-btn {
    transition: var(--transition);
}

.settings-item-btn:hover {
    border-color: var(--primary-light) !important;
    background: #f8faff !important;
}

.badge-pdf {
    font-size: 0.7rem;
    font-weight: 800;
    background: #eff6ff;
    color: #2563eb;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
}

/* ==========================================================================
   NAVIGATION PAR ONGLETS (TYPE APPLICATION NATIVE - BARRE HAUTE MUNICIPALE)
   ========================================================================== */
.nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 1.15rem;
    border: 1.5px solid #d8e2ec;
    margin-top: 0.5rem;
    margin-bottom: 0.95rem;
    width: 100%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.2rem;
    background: transparent;
    border: none;
    border-radius: 0.85rem;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    height: 54px;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.85);
}

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

.tab-btn.active {
    background: #1e3a8a; /* Bleu Marianne / Municipal officiel */
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(30, 58, 138, 0.28);
}

.tab-btn.active .tab-btn-label {
    color: #ffffff;
    font-weight: 800;
}

.tab-icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.tab-btn-label {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-align: center;
}

.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 {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.tab-btn.active .tab-counter {
    border-color: #1e3a8a;
}

.tab-counter.empty {
    display: none !important;
}

.tab-counter.alert {
    background: #dc2626;
    color: #ffffff;
}

.registre-subbar-hint {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.registre-subbar-hint svg {
    width: 14px;
    height: 14px;
    color: #2563eb;
}

/* 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;
}

.btn-compact-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-subtle);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.btn-compact-shortcut:hover {
    background: #dbeafe;
    border-color: var(--primary-light);
}

.btn-compact-shortcut svg {
    width: 13px;
    height: 13px;
}

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

/* Groupement moderne Lieu + Auteur */
.ios-form-group {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1rem;
}

@media (max-width: 680px) {
    .ios-form-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

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

.section-title-compact,
.section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.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: 1rem;
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

.pill-select-input {
    width: 100%;
    height: 48px;
    padding: 0 2.5rem 0 2.85rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    outline: none;
    cursor: pointer;
    box-shadow: 0 1px 3px 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 3px 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: 768px) {
    .category-pills-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.6rem 0.85rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    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.04);
}

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

.category-pill-btn .pill-emoji {
    font-size: 1.35rem;
    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: 700;
    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 (4 ÉTATS CLAIRS & VISUELS) */
.segmented-control-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 4px;
    gap: 4px;
    min-height: 52px;
}

@media (max-width: 520px) {
    .segmented-control-modern {
        grid-template-columns: repeat(2, 1fr);
        border-radius: 1rem;
        min-height: auto;
    }
}

.segment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    border-radius: 0.95rem;
    background: transparent;
    border: 1.5px solid transparent;
    font-size: 0.82rem;
    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: 1rem;
    line-height: 1;
}

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

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

.segment-btn[data-status="a_planifier"].active,
.segment-btn[data-status="constate_attente"].active {
    background: #ffffff;
    color: #1e40af;
    border-color: #bfdbfe;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

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

/* 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 & BANDEAU KPI 1 LIGNE COMPACT
   ========================================================================== */
.kpi-banner-strip {
    display: none !important;
}

.kpi-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.35rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    text-align: center;
    min-width: 0;
    transition: transform 0.15s ease;
}

.kpi-pill:active {
    transform: scale(0.98);
}

.kpi-pill-num {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
    font-feature-settings: "tnum";
}

.kpi-pill-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 2px;
}

.kpi-pill-total {
    border-color: rgba(37, 99, 235, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.kpi-pill-total .kpi-pill-num { color: #1d4ed8; }

.kpi-pill-faits {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
}
.kpi-pill-faits .kpi-pill-num { color: #047857; }

.kpi-pill-encours {
    border-color: rgba(245, 158, 11, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}
.kpi-pill-encours .kpi-pill-num { color: #b45309; }

.kpi-pill-attente {
    border-color: rgba(239, 68, 68, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
}
.kpi-pill-attente .kpi-pill-num { color: #b91c1c; }

/* Barre d'action Registre */
.registre-subbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0 0.15rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.registre-subbar-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-toggle-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.btn-toggle-filters:hover, .btn-toggle-filters.active {
    color: var(--primary);
    border-color: var(--primary-light);
    background: var(--primary-subtle);
}

.btn-toggle-filters svg {
    width: 13px;
    height: 13px;
}

/* Tiroir filtres rétractable */
.registre-filters-drawer {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    animation: slideDownDrawer 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownDrawer {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.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 {
    width: 100%;
}

.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;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 2;
}

.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.in-progress { color: #d97706; }
.status-indicator.pending { color: var(--warning-dark); }
.status-indicator.danger { color: var(--danger); }

/* Boutons d'action directe de changement d'état sur les cartes */
.status-action-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.btn-action-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-action-status svg {
    width: 11px;
    height: 11px;
}

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

.btn-status-done {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.btn-status-done:hover {
    background: #dcfce7;
}

.btn-status-progress {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}
.btn-status-progress:hover {
    background: #fef3c7;
}

.btn-status-pending {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.btn-status-pending:hover {
    background: #dbeafe;
}

/* ==========================================================================
   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.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

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

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    max-width: 520px;
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card > form,
.modal-card form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

@keyframes zoomModal {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.btn-close-modal {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-close-modal:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.btn-close-modal svg {
    width: 1.1rem;
    height: 1.1rem;
}

.modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-intro {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    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 en mode tableau, masquées en mode calendrier */
    .desktop-only-table {
        display: none !important;
    }

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

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

/* Optimisations spécifiques pour écrans compacts (iPhone 16e, iPhone 15/14, iPhone SE) */
@media (max-width: 480px) {
    .app-container {
        padding: 0.4rem;
        gap: 0.6rem;
    }

    .card-flash {
        padding: 0.75rem 0.65rem;
        border-radius: var(--radius-md);
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-header {
        padding: 0.65rem 0.85rem;
        border-radius: var(--radius-md);
        gap: 0.5rem;
    }

    .logo-icon-wrapper {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 0.65rem;
    }

    .logo-emoji {
        font-size: 1.25rem;
    }

    .header-titles h1 {
        font-size: 1.05rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .btn-gear-settings {
        width: 2.35rem;
        height: 2.35rem;
    }

    .btn-gear-settings svg {
        width: 1.15rem;
        height: 1.15rem;
    }

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

    .card-header-clean {
        margin-bottom: 0.65rem;
    }

    .form-main-title {
        font-size: 1.05rem;
    }

    .form-grid-clean {
        gap: 0.75rem;
    }

    .nav-tabs {
        gap: 0.15rem;
        padding: 0.25rem;
        border-radius: 0.85rem;
        margin-top: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .tab-btn {
        height: 52px;
        padding: 0.35rem 0.15rem;
        font-size: 0.68rem;
    }

    .tab-btn-emoji {
        font-size: 1.15rem;
    }

    .pill-select-input {
        height: 44px;
        padding: 0 2.2rem 0 2.6rem;
        font-size: 16px !important;
    }

    .pill-select-icon {
        left: 0.85rem;
        font-size: 1.05rem;
    }

    .pill-select-chevron {
        right: 0.85rem;
    }

    .section-title-compact,
    .section-title {
        font-size: 0.88rem;
        font-weight: 800;
        margin-bottom: 0.3rem;
    }

    .category-pills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
    }

    .category-pill-btn {
        padding: 0.65rem 0.65rem;
        min-height: 48px;
        border-radius: 0.75rem;
        gap: 0.45rem;
    }

    .category-pill-btn .pill-emoji {
        font-size: 1.25rem;
    }

    .category-pill-btn .pill-title {
        font-size: 0.82rem;
        font-weight: 700;
    }

    .btn-compact-photo {
        padding: 0.65rem 0.85rem;
        border-radius: 0.75rem;
    }

    .photo-btn-icon {
        font-size: 1.15rem;
    }

    .photo-btn-text {
        font-size: 0.8rem;
    }

    .segmented-control-modern {
        grid-template-columns: repeat(2, 1fr);
        padding: 3px;
        gap: 3px;
    }

    .segment-btn {
        padding: 0.45rem 0.35rem;
        font-size: 0.75rem;
    }

    .ios-switch-card {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        border-radius: 0.85rem;
    }

    .ios-switch-title {
        font-size: 0.78rem;
    }

    .ios-switch-sub {
        font-size: 0.65rem;
    }

    .btn-submit-gradient {
        padding: 0.8rem;
        font-size: 0.92rem;
        border-radius: 0.85rem;
    }

    /* BANDEAU KPI 1 LIGNE SUR IPHONE */
    .kpi-banner-strip {
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .kpi-pill {
        padding: 0.35rem 0.15rem;
        border-radius: 7px;
    }

    .kpi-pill-num {
        font-size: 1.05rem;
    }

    .kpi-pill-lbl {
        font-size: 0.58rem;
    }

    .registre-subbar {
        margin-bottom: 0.5rem;
    }

    .registre-subbar-title {
        font-size: 0.88rem;
    }

    .btn-toggle-filters {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    /* MODAL IPHONE ANTI-BLOCAGE */
    .modal-overlay {
        padding: 0.35rem;
        align-items: center;
    }

    .modal-card {
        max-height: calc(100dvh - 0.75rem);
        max-height: calc(100vh - 0.75rem);
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 0.75rem 0.85rem;
    }

    .modal-header h3 {
        font-size: 0.88rem;
    }

    .modal-body {
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .modal-footer {
        padding: 0.65rem 0.85rem;
    }

    .modal-footer .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
    }

    .constat-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .status-action-pill-group {
        width: 100%;
        margin-top: 0.2rem;
    }

    .btn-action-status {
        flex: 1;
        justify-content: center;
        padding: 0.35rem 0.5rem;
    }
}

/* ==========================================================================
   V4 ARCHITECTURE : SAISIE EXPRESS (+) & TABLEAU DE BORD UNIFIÉ
   ========================================================================== */

#tab-terrain {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 1. CARTE SAISIE EXPRESS (ZÉRO SCROLL SMARTPHONE) */
.card-flash {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .card-flash {
        padding: 1.5rem 1.75rem;
        border-radius: 24px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    }
}

.flash-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Header express : titre + sélecteur auteur */
.flash-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
}

.flash-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0f172a;
    flex-shrink: 0;
}

.flash-author-picker {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    max-width: 100%;
    min-width: 0;
}

.flash-author-select {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    max-width: 155px;
    text-overflow: ellipsis;
}

.flash-author-select:focus {
    border-color: #2563eb;
}

/* Gros bouton tactile photo */
.flash-photo-section {
    width: 100%;
}

.btn-flash-photo {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #eff6ff;
    border: 2px dashed #93c5fd;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-flash-photo:hover, .btn-flash-photo:active {
    background: #dbeafe;
    border-color: #3b82f6;
    transform: scale(0.99);
}

.flash-photo-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.flash-photo-text {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.flash-photo-text strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e40af;
}

.flash-photo-text span {
    font-size: 0.68rem;
    color: #3b82f6;
    font-weight: 500;
}

/* Champs express */
.flash-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.flash-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #1e293b;
    padding: 0 0.15rem;
}

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

.btn-flash-dictate {
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-flash-dictate:hover {
    background: #eff6ff;
}

.input-flash {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

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

/* Grille 3 catégories épurée */
.flash-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    width: 100%;
}

.btn-flash-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.6rem 0.35rem;
    min-height: 52px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    line-height: 1.15;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-flash-cat:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-flash-cat.active[data-cat="espaces_verts"] {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18);
}

.btn-flash-cat.active[data-cat="batiment"] {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18);
}

.btn-flash-cat.active[data-cat="autre"] {
    background: #f8fafc;
    border-color: #64748b;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.18);
}

/* 5. Statut du relevé : 4 boutons larges tactiles et faciles à cocher */
.flash-status-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.flash-status-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
}

.flash-status-chips {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    width: 100%;
}

.btn-flash-status {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.65rem 0.25rem;
    min-height: 46px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.2;
}

.btn-flash-status:hover {
    background: #f1f5f9;
}

.btn-flash-status.active[data-status="a_planifier"] {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.18);
}

.btn-flash-status.active[data-status="en_cours"] {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.18);
}

.btn-flash-status.active[data-status="urgent_danger"] {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.18);
}

.btn-flash-status.active[data-status="fait_realise"] {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.18);
}

/* Carte Notifier par mail (Haute visibilité pour Christophe & le Maire) */
.flash-notify-card {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    margin-top: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.flash-notify-card:hover {
    border-color: #4ade80;
}

.flash-notify-card.off {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.flash-notify-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.flash-notify-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.flash-notify-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.flash-notify-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.flash-notify-sub {
    display: block;
    font-size: 0.72rem;
    color: #15803d;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0.1rem;
    transition: color 0.2s ease;
}

.flash-notify-card.off .flash-notify-sub {
    color: #64748b;
}

/* Switch iOS grande taille (haute visibilité sur smartphone) */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .25s;
    border-radius: 34px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

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

.custom-switch input:checked + .switch-slider {
    background-color: #16a34a;
}

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

/* Bouton submit express */
.btn-flash-submit {
    width: 100%;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.btn-flash-submit:hover {
    background: linear-gradient(135deg, #172554, #1d4ed8);
}

.btn-flash-submit:active {
    transform: scale(0.985);
}

/* 2. TABLEAU DE BORD UNIFIÉ (SOUS-MENU FILTRES DE STATUT DISSO-CIÉ DU MENU PRINCIPAL) */
.board-tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    background: transparent;
    padding: 0;
    margin-bottom: 0.85rem;
}

.board-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.35rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.board-tab-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

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

/* État actif : À faire (Rouge vibrant) */
.board-tab-btn.active[data-filter="todo"] {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.18);
}
.board-tab-btn.active[data-filter="todo"] .board-tab-badge {
    background: #ef4444;
    color: #ffffff;
}

/* État actif : En cours (Ambre vibrant) */
.board-tab-btn.active[data-filter="progress"] {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.18);
}
.board-tab-btn.active[data-filter="progress"] .board-tab-badge {
    background: #f59e0b;
    color: #ffffff;
}

/* État actif : Terminé (Émeraude vibrant) */
.board-tab-btn.active[data-filter="done"] {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.18);
}
.board-tab-btn.active[data-filter="done"] .board-tab-badge {
    background: #10b981;
    color: #ffffff;
}

.board-tab-badge {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    transition: all 0.18s ease;
}

.badge-todo {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-progress {
    background: #fef3c7;
    color: #92400e;
}

.badge-done {
    background: #d1fae5;
    color: #065f46;
}

.registre-subbar-left {
    display: flex;
    align-items: center;
}

.registre-subbar-hint {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: -0.01em;
}

.registre-subbar-hint i {
    color: #2563eb;
    width: 15px;
    height: 15px;
}

.registre-subbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-subbar-demande {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1.5px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

/* ==========================================================================
   TABLEAU DE BORD UNIFIÉ (MULTI-COLONNES MACBOOK/DESKTOP & 1 COL IPHONE)
   ========================================================================== */

/* Grille réactive : 1 colonne sur mobile & tablette portrait (iPad mini / Android), 
   2 colonnes sur tablette paysage / écran moyen (>= 860px), 
   3 colonnes sur MacBook & grand écran (>= 1220px) */
.unified-board-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    width: 100%;
    align-items: stretch;
}

@media (min-width: 860px) {
    .unified-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.2rem;
    }
}

@media (min-width: 1220px) {
    .unified-board-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.unified-board-grid .empty-state {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Carte unifiée style outil pro / SaaS d'entreprise avec Container Query */
.unified-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    container-type: inline-size;
}

.unified-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    border-color: #cbd5e1;
}

/* Bordures gauches distinctives selon état */
.card-todo-item {
    border-left: 5px solid #ef4444;
}

.card-progress-item {
    border-left: 5px solid #f59e0b;
}

.card-done-item {
    border-left: 5px solid #10b981;
}

.unified-card-main-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* En-tête de carte (Badges épurés à gauche + Date & Heure toujours propre et alignée) */
.unified-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    flex-wrap: wrap;
}

.unified-card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1 1 auto;
}

.card-origin-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.48rem;
    border-radius: 6px;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

.card-origin-pill i {
    width: 11px;
    height: 11px;
}

.origin-elu {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.origin-tech {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.card-cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.48rem;
    border-radius: 6px;
    font-size: 0.67rem;
    font-weight: 700;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.card-urgent-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.48rem;
    border-radius: 6px;
    font-size: 0.67rem;
    font-weight: 800;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    white-space: nowrap;
    animation: urgentPulse 1.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Bannière d'intervention planifiée / rendez-vous (très visible pour le suivi de Christophe et du Maire) */
.card-planned-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.card-planned-banner:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.planned-banner-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.planned-banner-icon {
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.planned-banner-text {
    line-height: 1.25;
}

.planned-banner-text strong {
    font-weight: 800;
}

.planned-banner-edit-hint {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.75;
    white-space: nowrap;
}

.card-planned-banner.planned-today {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.card-planned-banner.planned-tomorrow {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.card-planned-banner.planned-soon {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.card-planned-banner.planned-future {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

.card-planned-banner.planned-overdue {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Bouton pour planifier sur une carte */
.btn-card-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-card-plan:hover {
    background: #e2e8f0;
    color: #1e3a8a;
    border-color: #94a3b8;
}

.btn-card-plan i {
    width: 12px;
    height: 12px;
}

/* Bloc planification dans les formulaires */
.flash-planning-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.65rem;
    transition: all 0.2s ease;
}

.planning-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.planning-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.planning-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #1e3a8a;
    cursor: pointer;
}

.planning-toggle-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.planning-hint-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.planning-fields-wrapper {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #cbd5e1;
}

.planning-quick-row {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.btn-planning-quick {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-planning-quick.active, .btn-planning-quick:hover {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
}

.planning-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.planning-input-group {
    display: flex;
    flex-direction: column;
}

.planning-sublabel {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.25rem;
}

/* Encart Date & Heure pro (très visible pour le suivi du maire et de Christophe) */
.unified-card-top-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}

.unified-card-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.unified-card-date-badge i {
    width: 13px;
    height: 13px;
    color: #64748b;
    flex-shrink: 0;
}

.unified-card-date-badge.date-today {
    background: #ecfdf5;
    color: #065f46;
    border-color: #6ee7b7;
    font-weight: 800;
}

.unified-card-date-badge.date-today i {
    color: #059669;
}

.unified-card-date-badge.date-yesterday {
    background: #eff6ff;
    color: #1e40af;
    border-color: #93c5fd;
    font-weight: 700;
}

.unified-card-date-badge.date-yesterday i {
    color: #2563eb;
}

.btn-delete-card {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-delete-card:hover {
    background: #fca5a5;
    color: #991b1b;
}

.btn-delete-card i {
    width: 13px;
    height: 13px;
}

/* Titre & Localisation */
.unified-card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.1rem;
}

.title-pin-icon {
    width: 17px;
    height: 17px;
    color: #2563eb;
    flex-shrink: 0;
    margin-top: 2px;
}

.unified-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* Boîte de description détaillée */
.unified-card-desc-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 0.6rem 0.8rem;
}

.unified-card-desc {
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.45;
    margin: 0;
}

/* Pied de carte avec Auteur très mis en valeur + Bouton d'action (ZÉRO SUPERPOSITION) */
.unified-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
    flex-wrap: wrap; /* Toujours autoriser le retour à la ligne pour empêcher tout chevauchement */
}

.card-author-block {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
}

.author-avatar {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.author-avatar-elu {
    background: #ede9fe;
    border: 1.5px solid #c4b5fd;
}

.author-avatar-st {
    background: #e0f2fe;
    border: 1.5px solid #7dd3fc;
}

.author-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
    flex: 1;
}

.author-role-label {
    font-size: 0.63rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-name {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.card-action-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Boutons d'action */
.btn-board-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-board-action i {
    width: 14px;
    height: 14px;
}

.btn-board-action:active {
    transform: scale(0.97);
}

.btn-board-action.action-take {
    background: #1e3a8a;
    color: #ffffff;
}

.btn-board-action.action-take:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-board-action.action-finish {
    background: #059669;
    color: #ffffff;
}

.btn-board-action.action-finish:hover {
    background: #047857;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

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

.stamp-registry-done {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 800;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    letter-spacing: -0.01em;
}

.stamp-registry-done i {
    width: 13px;
    height: 13px;
}

/* Container query : Réorganisation automatique dès que la carte est sous 460px (iPad 2-col, smartphones, split-view) */
@container (max-width: 460px) {
    .unified-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .card-action-group {
        width: 100%;
        display: flex;
        gap: 0.45rem;
    }
    .btn-card-plan {
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    .btn-board-action {
        flex: 1.4;
        justify-content: center;
        text-align: center;
    }
}

/* Media query fallback pour écrans compacts */
@media (max-width: 640px) {
    .unified-card-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .card-action-group {
        width: 100%;
        display: flex;
        gap: 0.45rem;
    }
    .btn-card-plan {
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    .btn-board-action {
        flex: 1.4;
        justify-content: center;
        text-align: center;
    }
}

/* ============================================================ */
/* RUBAN PLANNING 7 JOURS & FILTRE RAPIDE URGENT                */
/* ============================================================ */
.week-ribbon-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.week-ribbon-days {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}

.week-ribbon-days::-webkit-scrollbar {
    display: none;
}

.week-ribbon-urgent-wrapper {
    flex-shrink: 0;
}

@media (max-width: 580px) {
    .week-ribbon-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .week-ribbon-urgent-wrapper {
        width: 100%;
    }
    .btn-ribbon-urgent {
        width: 100%;
        justify-content: center;
    }
}

.week-day-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.32rem 0.55rem;
    border-radius: 9px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 56px;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.week-day-pill:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.week-day-name {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1;
    letter-spacing: 0.02em;
}

.week-day-num {
    font-size: 0.86rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0;
    line-height: 1;
}

.week-day-badge {
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.05rem 0.38rem;
    line-height: 1.2;
    background: #e2e8f0;
    color: #94a3b8;
    min-width: 16px;
    text-align: center;
}

.week-day-badge.has-items {
    background: #dbeafe;
    color: #1e40af;
}

.week-day-pill.today {
    border-color: #fde68a;
    background: #fffbeb;
}

.week-day-pill.today .week-day-name {
    color: #b45309;
}

.week-day-pill.active {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
}

.week-day-pill.active .week-day-name,
.week-day-pill.active .week-day-num {
    color: #ffffff !important;
}

.week-day-pill.active .week-day-badge {
    background: #ffffff !important;
    color: #1e3a8a !important;
}

.week-ribbon-urgent-wrapper {
    flex-shrink: 0;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.65rem;
}

.btn-ribbon-urgent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.65rem;
    border-radius: 9px;
    font-size: 0.74rem;
    font-weight: 800;
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-ribbon-urgent:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.btn-ribbon-urgent.active {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

.ribbon-urgent-badge {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: #fee2e2;
    color: #991b1b;
    line-height: 1.2;
}

.btn-ribbon-urgent.active .ribbon-urgent-badge {
    background: #ffffff !important;
    color: #dc2626 !important;
}

.ribbon-filter-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: #1e40af;
    margin-bottom: 0.85rem;
}

.ribbon-indicator-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-clear-ribbon-filter {
    background: none;
    border: none;
    font-size: 0.74rem;
    font-weight: 700;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ============================================================ */
/* FILTRES & BADGES AGENDA MUNICIPAL UNIFIÉ                     */
/* ============================================================ */
.agenda-filter-chips {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.agenda-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agenda-chip-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.agenda-chip-btn.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
}

.agenda-chip-count {
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #475569;
}

.agenda-chip-btn.active .agenda-chip-count {
    background: #3b82f6;
    color: #ffffff;
}

.agenda-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.48rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    white-space: nowrap;
}

.agenda-type-st {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.agenda-type-elu {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.agenda-type-ent {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ============================================================ */
/* CALENDRIER MENSUEL VISUEL / 2 SEMAINES (AGENDA MUNICIPAL)    */
/* ============================================================ */
.agenda-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
}

.agenda-month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-agenda-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-agenda-nav:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-agenda-nav i {
    width: 16px;
    height: 16px;
}

.agenda-current-month-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
    min-width: 140px;
    text-align: center;
    text-transform: capitalize;
}

.btn-agenda-today {
    padding: 0.28rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-agenda-today:hover {
    background: #e2e8f0;
    color: #1e3a8a;
}

.agenda-view-toggles {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.agenda-subtoggle-group {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.btn-agenda-view-mode, .btn-agenda-display-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    font-size: 0.73rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-agenda-view-mode:hover, .btn-agenda-display-type:hover {
    background: #f1f5f9;
}

.btn-agenda-view-mode.active, .btn-agenda-display-type.active {
    background: #1e3a8a;
    color: #ffffff;
}

.btn-agenda-display-type i {
    width: 13px;
    height: 13px;
}

/* Grille du calendrier */
.agenda-calendar-wrapper {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1rem;
}

.agenda-weekdays-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f5f9;
    border-bottom: 1.5px solid #cbd5e1;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    padding: 0.45rem 0;
    letter-spacing: 0.03em;
}

.agenda-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
}

.agenda-calendar-cell {
    background: #ffffff;
    min-height: 98px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.agenda-calendar-cell:hover {
    background: #f8fafc;
}

.agenda-calendar-cell.today {
    background: #fffdf5;
    box-shadow: inset 0 0 0 2px #f59e0b;
}

.agenda-calendar-cell.other-month {
    background: #f8fafc;
    opacity: 0.45;
}

.agenda-calendar-cell.selected {
    box-shadow: inset 0 0 0 2px #1e3a8a;
    background: #f0fdfa;
}

.cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.cell-day-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.agenda-calendar-cell.today .cell-day-num {
    color: #b45309;
}

.cell-badge-count {
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
    line-height: 1.2;
    background: #dbeafe;
    color: #1e40af;
}

.cell-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow-y: auto;
    max-height: 85px;
}

.agenda-event-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.38rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event-chip:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.chip-st {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.chip-ent {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.chip-elu {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.chip-time {
    font-weight: 800;
    font-size: 0.62rem;
    flex-shrink: 0;
    opacity: 0.9;
}

.chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Points d'activité mobile */
.cell-mobile-dots {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2.5px;
    margin-top: 2px;
}

.mobile-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.mobile-dot.dot-st { background: #0284c7; }
.mobile-dot.dot-ent { background: #d97706; }
.mobile-dot.dot-elu { background: #7c3aed; }

/* Panneau de détail du jour cliqué sous le calendrier */
.agenda-day-details-box {
    background: #f8fafc;
    border-top: 1.5px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.agenda-day-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.agenda-day-details-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}

.badge-count-sub {
    font-size: 0.68rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.agenda-day-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
}

.agenda-day-item-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s ease;
}

.agenda-day-item-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.day-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.day-item-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.day-item-meta {
    font-size: 0.74rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.day-item-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

@media (max-width: 640px) {
    .agenda-toolbar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .agenda-month-nav {
        justify-content: space-between;
    }
    .agenda-view-toggles {
        justify-content: space-between;
    }
    .agenda-calendar-cell {
        min-height: 54px;
        padding: 0.25rem 0.15rem;
    }
    .cell-events-list {
        display: none;
    }
    .cell-mobile-dots {
        display: flex;
    }
    .desktop-text {
        display: none;
    }
}




