    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    body {
      font-family: 'Inter', sans-serif;
      background: #FFFFFF;
      color: #0F172A;
      line-height: 1.6;
    }
    a { text-decoration: none; color: inherit; }
    button { cursor: pointer; border: none; font-family: 'Inter', sans-serif; }
    input, textarea, select { font-family: 'Inter', sans-serif; }

    /* LANDING PAGE */
    .landing {
      display: none;
      flex-direction: column;
      min-height: 100vh;
    }
    .landing.active {
      display: flex;
    }

    /* TOP BAR */
    .topbar {
      background: #FFFFFF;
      border-bottom: 1px solid #E2E8F0;
      padding: 16px 40px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .topbar-left {
      display: flex;
      align-items: center;
      gap: 40px;
    }
    .logo {
      font-size: 22px;
      font-weight: 700;
      color: #1E293B;
      display: flex;
      align-items: center;
      gap: 0;
      letter-spacing: 0.5px;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    .topbar-nav {
      display: flex;
      gap: 32px;
    }
    .topbar-nav a {
      color: #0F172A;
      font-size: 14px;
      font-weight: 500;
      transition: color 0.2s;
    }
    .topbar-nav a:hover {
      color: #1E3A5F;
    }
    .topbar-right {
      display: flex;
      gap: 16px;
    }
    .btn-primary {
      background: #1E3A5F;
      color: white;
      padding: 10px 24px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      transition: background 0.2s;
    }
    .btn-primary:hover {
      background: #16293F;
    }
    .btn-outline {
      background: transparent;
      color: #1E3A5F;
      border: 1px solid #1E3A5F;
      padding: 10px 24px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      transition: all 0.2s;
    }
    .btn-outline:hover {
      background: #1E3A5F;
      color: white;
    }

    /* HERO */
    .hero {
      background: linear-gradient(135deg, #1E3A5F 0%, #16293F 100%);
      color: white;
      padding: 52px 40px 40px;
      text-align: center;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .hero-badge {
      display: inline-block;
      background: rgba(255,255,255,0.18);
      border: 1px solid rgba(255,255,255,0.3);
      border-radius: 20px;
      padding: 5px 16px;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.03em;
      margin-bottom: 18px;
    }
    .hero h1 {
      font-size: 42px;
      font-weight: 800;
      margin-bottom: 14px;
      line-height: 1.15;
    }
    .hero p {
      font-size: 16px;
      font-weight: 400;
      margin-bottom: 24px;
      opacity: 0.9;
    }
    .hero-services {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 14px;
      max-width: 860px;
      margin: 28px auto 0;
    }
    .hero-service-card {
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.22);
      border-radius: 14px;
      padding: 18px 16px;
      text-align: left;
      backdrop-filter: blur(4px);
      transition: background 0.2s;
    }
    .hero-service-card:hover { background: rgba(255,255,255,0.18); }
    .hero-service-icon {
      width: 38px; height: 38px;
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px;
      margin-bottom: 10px;
    }
    .hero-service-title {
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 5px;
    }
    .hero-service-desc {
      font-size: 12px;
      opacity: 0.8;
      line-height: 1.5;
    }
    @media (max-width: 700px) {
      .hero-services { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
      .hero-service-card { text-align: center; padding: 14px; }
      .hero-service-icon { margin: 0 auto 8px; }
      .hero h1 { font-size: 26px; }
    }
    .hero-buttons {
      display: flex;
      gap: 16px;
      justify-content: center;
    }
    .btn-white {
      background: white;
      color: #1E3A5F;
      padding: 12px 32px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      transition: all 0.2s;
    }
    .btn-white:hover {
      background: #F0F9FF;
    }

    /* STATS BAR */
    .stats-bar {
      background: rgba(255,255,255,0.12);
      backdrop-filter: blur(8px);
      border-top: 1px solid rgba(255,255,255,0.2);
      border-bottom: 1px solid rgba(255,255,255,0.2);
      padding: 20px 40px;
    }
    .stats-bar-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      max-width: 800px;
      margin: 0 auto;
      flex-wrap: wrap;
    }
    .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 8px 32px;
    }
    .stat-number {
      font-size: 26px;
      font-weight: 800;
      color: #FFFFFF;
      line-height: 1;
    }
    .stat-label {
      font-size: 12px;
      color: rgba(255,255,255,0.75);
      margin-top: 4px;
      text-align: center;
    }
    .stat-divider {
      width: 1px;
      height: 36px;
      background: rgba(255,255,255,0.25);
    }
    @media (max-width: 600px) {
      .stats-bar { padding: 16px 20px; }
      .stat-item { padding: 8px 16px; }
      .stat-number { font-size: 20px; }
      .stat-divider { display: none; }
    }

    /* FEATURES */
    .features {
      padding: 80px 40px;
      background: #FFFFFF;
    }
    .features h2 {
      text-align: center;
      font-size: 36px;
      font-weight: 800;
      margin-bottom: 48px;
      color: #0F172A;
    }
    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 32px;
      max-width: 1200px;
      margin: 0 auto;
    }
    .feature-card {
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      padding: 32px;
      text-align: center;
      transition: all 0.3s;
    }
    .feature-card:hover {
      border-color: #1E3A5F;
      box-shadow: 0 4px 20px rgba(30, 58, 95, 0.1);
      transform: translateY(-4px);
    }
    .feature-card i {
      font-size: 40px;
      color: #1E3A5F;
      margin-bottom: 16px;
    }
    .feature-card h3 {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 12px;
    }
    .feature-card p {
      font-size: 14px;
      color: #64748B;
    }

    /* PRICING */
    .pricing {
      padding: 80px 40px;
      background: #F8FAFC;
    }
    .pricing h2 {
      text-align: center;
      font-size: 36px;
      font-weight: 800;
      margin-bottom: 48px;
      color: #0F172A;
    }
    .pricing-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 32px;
      max-width: 1200px;
      margin: 0 auto;
    }
    .pricing-card {
      background: white;
      border-radius: 12px;
      padding: 40px 32px;
      text-align: center;
      border: 1px solid #E2E8F0;
      transition: all 0.3s;
    }
    .pricing-card.featured {
      border-color: #1E3A5F;
      box-shadow: 0 8px 30px rgba(30, 58, 95, 0.2);
      transform: scale(1.02);
    }
    .pricing-card h3 {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 12px;
    }
    .pricing-card .price {
      font-size: 32px;
      font-weight: 800;
      color: #1E3A5F;
      margin-bottom: 4px;
    }
    .pricing-card .period {
      font-size: 14px;
      color: #64748B;
      margin-bottom: 24px;
    }
    .pricing-card ul {
      list-style: none;
      margin-bottom: 32px;
      text-align: left;
    }
    .pricing-card li {
      padding: 8px 0;
      font-size: 14px;
      color: #64748B;
    }
    .pricing-card li:before {
      content: "✓";
      color: #10B981;
      font-weight: bold;
      margin-right: 8px;
    }
    .pricing-card .btn-primary {
      width: 100%;
    }

    /* FOOTER */
    .footer {
      background: #0F172A;
      color: white;
      padding: 40px;
      text-align: center;
      font-size: 14px;
    }
    .footer-badges {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 24px;
      flex-wrap: wrap;
      margin-bottom: 24px;
      padding-bottom: 24px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .footer-badge {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 13px;
      color: rgba(255,255,255,0.7);
    }
    .footer-badge i { font-size: 14px; }

    /* APP */
    .app {
      display: none;
      height: 100vh;
    }
    .app.active {
      display: flex;
    }

    /* SIDEBAR */
    .sidebar {
      width: 260px;
      background: #0F172A;
      color: white;
      overflow-y: auto;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      border-right: 1px solid #1E293B;
    }
    .sidebar-logo {
      padding: 24px 20px;
      font-size: 20px;
      font-weight: 700;
      color: #F8FAFC;
      border-bottom: 1px solid #1E293B;
      letter-spacing: 0.5px;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    .sidebar-section {
      padding: 20px 0;
      border-bottom: 1px solid #1E293B;
    }
    .sidebar-section-title {
      padding: 0 20px 12px 20px;
      font-size: 11px;
      font-weight: 700;
      color: #64748B;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .sidebar-item {
      padding: 12px 20px;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .sidebar-item:hover {
      background: rgba(255, 255, 255, 0.05);
    }
    .sidebar-item.active {
      background: rgba(201, 162, 39, 0.12);
      border-left: 3px solid #C9A227;
      padding-left: 17px;
      color: #F8FAFC;
      font-weight: 600;
    }
    .sidebar-item.active i {
      color: #C9A227;
    }
    .sidebar-item i {
      width: 16px;
      text-align: center;
    }
    .sidebar-bottom {
      margin-top: auto;
      padding: 20px;
      border-top: 1px solid #1E293B;
    }
    .sidebar-item.trash {
      color: #EF4444;
    }

    /* MAIN AREA */
    .main-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .app-topbar {
      background: white;
      border-bottom: 1px solid #E2E8F0;
      padding: 16px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-shrink: 0;
    }
    .breadcrumb {
      font-size: 14px;
      color: #64748B;
    }
    .breadcrumb a {
      color: #1E3A5F;
    }
    .app-topbar-right {
      display: flex;
      gap: 16px;
      align-items: center;
    }
    .search-input {
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 14px;
      width: 200px;
    }
    .icon-btn {
      background: transparent;
      color: #64748B;
      cursor: pointer;
      font-size: 18px;
      transition: color 0.2s;
    }
    .icon-btn:hover {
      color: #1E3A5F;
    }
    .user-avatar {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: #1E3A5F;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
    }
    .dropdown-menu {
      position: absolute;
      top: 100%;
      right: 0;
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      min-width: 160px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      display: none;
      z-index: 1000;
    }
    .dropdown-menu.active {
      display: block;
    }
    .dropdown-menu a {
      display: block;
      padding: 10px 16px;
      font-size: 14px;
      color: #0F172A;
      transition: background 0.2s;
    }
    .dropdown-menu a:hover {
      background: #F8FAFC;
    }
    .dropdown-menu a.danger {
      color: #EF4444;
    }

    /* CONTENT */
    #content {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
    }

    /* CARDS & STATS */
    .stat-card {
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    }
    .stat-card-label {
      font-size: 12px;
      color: #64748B;
      font-weight: 500;
      margin-bottom: 2px;
    }
    .stat-card-value {
      font-size: 26px;
      font-weight: 800;
      color: #1E3A5F;
      line-height: 1.15;
    }
    .ux-card {
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 14px;
      padding: 16px 18px;
      margin-bottom: 14px;
      box-shadow: 0 1px 2px rgba(15,23,42,0.03);
    }
    .ux-chip {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
      border: 1px solid #E2E8F0; background: white; color: #475569; cursor: pointer;
      min-height: 36px;
    }
    .ux-chip.active {
      background: #1E3A5F; color: white; border-color: #1E3A5F;
      box-shadow: inset 0 -2px 0 #C9A227;
    }
    .ux-chip.danger.active {
      background: #FEF2F2; color: #B91C1C; border-color: #FECACA;
      box-shadow: none;
    }
    .page-breadcrumb {
      font-size: 12px; color: #94A3B8; margin: -4px 0 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    }
    .page-breadcrumb a { color: #1E3A5F; text-decoration: none; font-weight: 600; }
    .page-breadcrumb a:hover { color: #C9A227; }

    /* GRID */
    .grid {
      display: grid;
      gap: 20px;
      margin-bottom: 24px;
    }
    .grid-2 {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .grid-4 {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* TABLES */
    .table-container {
      background: white;
      border-radius: 12px;
      border: 1px solid #E2E8F0;
      overflow-x: auto;
      overflow-y: visible;
      -webkit-overflow-scrolling: touch;
      margin-bottom: 24px;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 560px; /* empêche le tassement sur mobile — force le scroll horizontal */
    }
    thead {
      background: #F8FAFC;
      border-bottom: 1px solid #E2E8F0;
    }
    th {
      padding: 12px 16px;
      text-align: left;
      font-size: 13px;
      font-weight: 600;
      color: #64748B;
      white-space: nowrap;
    }
    td {
      padding: 12px 16px;
      border-top: 1px solid #E2E8F0;
      font-size: 14px;
    }
    tbody tr:hover {
      background: #F8FAFC;
    }
    /* ── MOBILE : carte par ligne (tables avec class .tbl-cards) ── */
    @media (max-width: 640px) {
      .tbl-cards { overflow-x: visible !important; }
      .tbl-cards table { min-width: 0 !important; width: 100% !important; }
      .tbl-cards thead { display: none; }
      .tbl-cards tbody tr {
        display: block;
        background: white;
        border: 1px solid #E5E7EB;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 14px 14px 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
      }
      .tbl-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 5px 0;
        border: none;
        font-size: 13px;
        line-height: 1.4;
        gap: 10px;
      }
      .tbl-cards tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        color: #9CA3AF;
        text-transform: uppercase;
        letter-spacing: .05em;
        white-space: nowrap;
        flex-shrink: 0;
        padding-top: 2px;
        min-width: 70px;
      }
      .tbl-cards tbody td:last-child {
        justify-content: flex-end;
        padding-top: 10px;
        border-top: 1px solid #F3F4F6;
        margin-top: 8px;
        gap: 6px;
      }
      .tbl-cards tbody td:last-child::before { content: none; }
      .tbl-cards tbody tr:hover { background: white !important; }
    }

    /* BUTTONS */
    .btn {
      padding: 10px 16px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 600;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 40px;
    }
    .btn-sm {
      padding: 6px 12px;
      font-size: 12px;
    }
    .btn-danger {
      background: var(--mi-danger, #DC2626);
      color: white;
      box-shadow: none;
    }
    .btn-danger:hover {
      background: #B91C1C;
    }
    .btn-success {
      background: #10B981;
      color: white;
    }
    .btn-warning {
      background: #F59E0B;
      color: white;
    }

    /* Design system lite — ManagImmo (navy / gold) */
    :root {
      --mi-navy: #1E3A5F;
      --mi-navy-dark: #16293F;
      --mi-gold: #C9A227;
      --mi-danger: #DC2626;
      --mi-muted: #64748B;
      --mi-border: #E2E8F0;
      --mi-surface: #F8FAFC;
    }
    .btn-secondary {
      background: #FFFFFF;
      color: var(--mi-navy);
      border: 1.5px solid var(--mi-navy);
      box-shadow: none;
    }
    .btn-secondary:hover {
      background: #F1F5F9;
      color: var(--mi-navy-dark);
      border-color: var(--mi-navy-dark);
    }
    .btn-ghost {
      background: transparent;
      color: #475569;
      border: 1px solid var(--mi-border);
      box-shadow: none;
    }
    .btn-ghost:hover {
      background: var(--mi-surface);
      color: var(--mi-navy);
      border-color: #CBD5E1;
    }
    .btn-primary {
      box-shadow: inset 0 -2px 0 var(--mi-gold);
    }
    .page-title {
      margin: 0 0 4px;
      font-size: 24px;
      font-weight: 800;
      color: #0F172A;
      letter-spacing: -0.02em;
    }
    .page-subtitle {
      margin: 0 0 14px;
      font-size: 13px;
      color: #94A3B8;
      font-weight: 500;
    }
    .dash-section {
      background: #FFFFFF;
      border-radius: 14px;
      border: 1px solid var(--mi-border);
      padding: 16px 18px;
      margin-bottom: 14px;
      box-shadow: 0 1px 2px rgba(15,23,42,0.03);
    }
    .dash-section h3 {
      margin: 0;
      font-size: 14px;
      font-weight: 700;
      color: var(--mi-navy);
    }
    .dash-section-link {
      color: var(--mi-navy);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .dash-section-link:hover { color: var(--mi-gold); }
    .dash-muted { color: #94A3B8; font-size: 12px; line-height: 1.45; }

    /* EMPTY STATE */
    .empty-state {
      text-align: center;
      padding: 56px 24px;
      max-width: 420px;
      margin: 24px auto;
      background: #F8FAFC;
      border: 1px dashed #E2E8F0;
      border-radius: 16px;
    }
    .empty-state i {
      font-size: 48px;
      color: #C9A227;
      margin-bottom: 14px;
      opacity: 0.85;
    }
    .empty-state h3 {
      font-size: 18px;
      font-weight: 600;
      color: #0F172A;
      margin-bottom: 8px;
    }
    .empty-state p {
      color: #64748B;
      font-size: 14px;
      margin-bottom: 20px;
      line-height: 1.5;
    }
    .empty-state .btn, .empty-state button {
      margin-top: 4px;
    }

    /* MODALS */
    .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 20000;
    }
    .modal.active {
      display: flex;
    }
    .modal-fullscreen-header {
      border-bottom: 1px solid #E2E8F0;
      box-shadow: inset 0 -2px 0 #C9A227;
    }
    .modal-fullscreen-header h2 { color: #1E3A5F; }
    .modal-content {
      background: white;
      border-radius: 12px;
      padding: 32px;
      max-width: 500px;
      width: 90%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
    }
    .modal-header h2 {
      font-size: 24px;
      font-weight: 700;
    }
    .close-btn {
      background: transparent;
      color: #64748B;
      font-size: 24px;
      cursor: pointer;
      transition: color 0.2s;
    }
    .close-btn:hover {
      color: #0F172A;
    }
    .form-group {
      margin-bottom: 16px;
    }
    .form-group label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 6px;
      color: #0F172A;
    }
    .form-group input,
    .form-group textarea,
    .form-group select {
      width: 100%;
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 14px;
      transition: border 0.2s;
    }
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
      outline: none;
      border-color: #1E3A5F;
      box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
    }
    .form-group textarea {
      resize: vertical;
      min-height: 100px;
    }

    /* ── Creation facile (Locataire / Bien / Location) ── */
    .cf-hint {
      background: linear-gradient(135deg, #F0F7FF 0%, #FFFBF0 100%);
      border: 1px solid #E2E8F0;
      border-left: 3px solid #C9A227;
      border-radius: 10px;
      padding: 12px 14px;
      margin-bottom: 16px;
      font-size: 13px;
      color: #334155;
      line-height: 1.45;
    }
    .cf-hint strong { color: #1E3A5F; }
    .cf-essentials {
      background: #FFFFFF;
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      padding: 16px 16px 4px;
      margin-bottom: 14px;
      box-shadow: 0 1px 0 rgba(30,58,95,0.04);
    }
    .cf-essentials-title {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: #1E3A5F;
      margin: 0 0 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .cf-essentials-title i { color: #C9A227; }
    .cf-req { color: #EF4444; font-weight: 700; margin-left: 2px; }
    .cf-opt {
      font-size: 11px;
      font-weight: 500;
      color: #94A3B8;
      margin-left: 4px;
    }
    .cf-plus {
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      margin-bottom: 14px;
      overflow: hidden;
      background: #F8FAFC;
    }
    .cf-plus-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 14px 16px;
      background: #F8FAFC;
      border: none;
      cursor: pointer;
      font-size: 14px;
      font-weight: 700;
      color: #1E3A5F;
      min-height: 44px;
      text-align: left;
      -webkit-tap-highlight-color: transparent;
    }
    .cf-plus-toggle:hover { background: #F1F5F9; }
    .cf-plus-toggle .cf-chevron {
      color: #C9A227;
      transition: transform 0.2s;
      font-size: 13px;
    }
    .cf-plus.open .cf-plus-toggle .cf-chevron { transform: rotate(180deg); }
    .cf-plus-body { display: none; padding: 4px 16px 12px; background: #FFFFFF; border-top: 1px solid #E2E8F0; }
    .cf-plus.open .cf-plus-body { display: block; }
    .cf-tabs-wrap { display: none; margin-bottom: 8px; }
    .cf-tabs-wrap.visible { display: block; }
    .cf-tabs-wrap .tab-nav {
      background: #F8FAFC;
      border: 1px solid #E2E8F0;
      border-radius: 10px;
      padding: 6px;
    }
    .modal-fullscreen-footer .btn-primary {
      background: #1E3A5F;
      box-shadow: inset 0 -2px 0 #C9A227;
      min-height: 44px;
      font-weight: 700;
    }
    .modal-fullscreen-footer .btn-secondary-cf {
      background: white;
      color: #64748B;
      border: 1px solid #E2E8F0;
      min-height: 44px;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      padding: 10px 24px;
      font-size: 14px;
    }
    .modal-fullscreen-footer .btn-secondary-cf:hover { background: #F8FAFC; color: #1E3A5F; border-color: #CBD5E1; }
    .cf-field-error {
      border-color: #EF4444 !important;
      box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
    }
    .cf-empty {
      grid-column: 1 / -1;
      padding: 48px 24px;
      text-align: center;
      background: white;
      border-radius: 14px;
      border: 1px dashed #CBD5E1;
    }
    .cf-empty i { font-size: 44px; color: #C9A227; margin-bottom: 14px; display: block; opacity: 0.85; }
    .cf-empty strong { font-size: 16px; color: #1E3A5F; display: block; }
    .cf-empty p { color: #64748B; font-size: 14px; margin: 8px 0 18px; }
    .cf-next-step {
      background: linear-gradient(135deg, #1E3A5F 0%, #2A4A6F 100%);
      color: white;
      border-radius: 14px;
      padding: 18px 20px;
      margin-bottom: 16px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
      box-shadow: 0 4px 14px rgba(30,58,95,0.25), inset 0 -2px 0 #C9A227;
    }
    .cf-next-step p { margin: 0; flex: 1 1 200px; font-size: 14px; line-height: 1.4; }
    .cf-next-step .cf-next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .cf-next-step button {
      min-height: 44px;
      padding: 10px 16px;
      border-radius: 8px;
      font-weight: 700;
      font-size: 13px;
      cursor: pointer;
      border: none;
    }
    .cf-next-step .cf-next-primary { background: #C9A227; color: #1E3A5F; }
    .cf-next-step .cf-next-ghost { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.35); }
    @media (max-width: 768px) {
      .cf-essentials, .cf-plus { margin-left: -4px; margin-right: -4px; }
      .cf-plus-toggle, .modal-fullscreen-footer .btn-primary,
      .modal-fullscreen-footer .btn-secondary-cf { min-height: 48px; }
      .cf-essentials .form-row { grid-template-columns: 1fr; }
    }

    /* TABS */
    .tabs-header {
      display: flex;
      gap: 0;
      border-bottom: 2px solid #E2E8F0;
      margin-bottom: 24px;
      overflow-x: auto;
    }
    .tab-btn {
      padding: 12px 16px;
      background: transparent;
      color: #64748B;
      font-size: 14px;
      font-weight: 600;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      margin-bottom: -2px;
    }
    .tab-btn.active {
      color: #1E3A5F;
      border-bottom-color: #1E3A5F;
    }
    .tab-content {
      display: none;
    }
    .tab-content.active {
      display: block;
    }

    /* LETTER CARDS */
    .letters-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }
    /* Inline editable placeholders in letter preview */
    .inline-ph {
      background: #FEF08A;
      padding: 1px 6px;
      border-radius: 3px;
      border: 1px dashed #D97706;
      color: #92400E;
      font-style: italic;
      cursor: text;
      min-width: 40px;
      display: inline-block;
      outline: none;
      transition: all 0.15s;
      line-height: 1.4;
    }
    .inline-ph:hover { background: #FDE047; box-shadow: 0 0 0 2px rgba(217,119,6,0.15); }
    .inline-ph:focus { background: #FFFBEB; border-color: #B45309; box-shadow: 0 0 0 2px rgba(217,119,6,0.3); font-style: normal; color: #1E293B; }
    .inline-ph.filled { background: #D1FAE5; border-color: #10B981; color: #065F46; font-style: normal; }
    .inline-ph.filled:hover { background: #A7F3D0; }
    .inline-ph.filled:focus { background: #ECFDF5; border-color: #059669; box-shadow: 0 0 0 2px rgba(16,185,129,0.3); }
    @media(max-width:768px) {
      .inline-ph { font-size: 16px; padding: 3px 8px; }
    }

    .letter-card {
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 8px;
      padding: 16px;
      text-align: center;
      transition: all 0.2s;
      cursor: pointer;
    }
    .letter-card:hover {
      border-color: #1E3A5F;
      box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
    }
    .letter-card i {
      font-size: 32px;
      color: #1E3A5F;
      margin-bottom: 8px;
    }
    .letter-card h4 {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 8px;
      line-height: 1.4;
      min-height: 40px;
    }
    .letter-card .letter-blurb {
      font-size: 12.5px;
      color: #64748B;
      line-height: 1.45;
      margin: 0 0 10px;
      flex: 1;
    }
    .letter-card .letter-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 12px;
    }
    .letter-card .letter-badge-tag {
      font-size: 10.5px;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: 999px;
      background: #F1F5F9;
      color: #334155;
      border: 1px solid #E2E8F0;
    }
    .letter-card .letter-badge-tag.gold {
      background: #FFFBEB;
      color: #92400E;
      border-color: #FDE68A;
    }
    .letter-card .letter-badge-tag.navy {
      background: #EFF6FF;
      color: #1E3A5F;
      border-color: #BFDBFE;
    }
    .letter-empty-state {
      grid-column: 1 / -1;
      text-align: center;
      padding: 48px 20px;
      color: #94A3B8;
      background: #fff;
      border: 1px dashed #E2E8F0;
      border-radius: 12px;
    }
    #letterRefsTip {
      background: #FFFBEB;
      border: 1px solid #FDE68A;
      border-radius: 8px;
      padding: 10px 12px;
      margin-bottom: 12px;
      font-size: 12.5px;
      color: #78350F;
      line-height: 1.5;
    }

    .letter-badge {
      display: inline-block;
      background: #F0F9FF;
      color: #16293F;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      margin-bottom: 8px;
    }
    .letter-card .btn-primary {
      width: 100%;
      padding: 8px 12px;
      font-size: 12px;
    }

    /* CATEGORY FILTERS */
    .category-filters {
      display: flex;
      gap: 8px;
      margin-bottom: 24px;
      overflow-x: auto;
      flex-wrap: wrap;
    }
    .cat-btn {
      background: white;
      border: 1px solid #E2E8F0;
      color: #0F172A;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s;
    }
    .cat-btn.active {
      background: #1E3A5F;
      color: white;
      border-color: #1E3A5F;
    }
    .cat-btn:hover {
      border-color: #1E3A5F;
    }

    /* CHARTS */
    .charts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
      gap: 20px;
      margin-bottom: 24px;
    }
    .chart-card {
      background: white;
      border: 1px solid #E2E8F0;
      border-radius: 12px;
      padding: 24px;
    }
    .chart-card h3 {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 16px;
    }

    /* SCROLLBAR */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: #CBD5E1;
      border-radius: 4px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: #94A3B8;
    }

    /* SIDEBAR EXPANDABLE */
    .sidebar-parent {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      cursor: pointer;
      color: #64748B;
      font-size: 14px;
      font-weight: 600;
      transition: all 0.2s;
      user-select: none;
    }
    .sidebar-parent:hover {
      background: #F8FAFC;
      color: #0F172A;
    }
    .sidebar-parent::after {
      content: '▼';
      font-size: 10px;
      transition: transform 0.2s;
    }
    .sidebar-parent.open::after {
      transform: rotate(-180deg);
    }
    .sidebar-submenu {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }
    .sidebar-parent.open ~ .sidebar-submenu,
    .sidebar-parent.open + .sidebar-submenu {
      max-height: 500px;
    }
    .sidebar-submenu .sidebar-item {
      padding-left: 32px;
      font-size: 13px;
    }

    /* MODAL FULLSCREEN */
    .modal-fullscreen {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(15, 23, 42, 0.35);
      z-index: 10001;
      align-items: center;
      justify-content: center;
      overflow-y: auto;
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
    }
    .modal-fullscreen.active {
      display: flex;
    }
    .modal-fullscreen-content {
      background: white;
      border-radius: 16px;
      width: 90%;
      max-width: 900px;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 0 12px 40px rgba(30, 58, 95, 0.16);
      border: 1px solid rgba(226,232,240,0.9);
      display: flex;
      flex-direction: column;
    }
    .modal-fullscreen-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 18px 20px;
      border-bottom: 1px solid #F1F5F9;
      background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
      flex: 0 0 auto;
      box-shadow: inset 0 -2px 0 #C9A227;
    }
    .modal-fullscreen-footer {
      display: flex;
      gap: 10px;
      padding: 14px 20px;
      border-top: 1px solid #F1F5F9;
      background: #F8FAFC;
      flex: 0 0 auto;
      box-shadow: 0 -1px 8px rgba(15,23,42,0.04);
    }
    .modal-fullscreen-header h2 {
      margin: 0;
      font-size: 20px;
      font-weight: 700;
    }
    .modal-fullscreen-close {
      background: transparent;
      border: none;
      font-size: 28px;
      color: #64748B;
      cursor: pointer;
      padding: 0;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .modal-fullscreen-close:hover {
      color: #0F172A;
    }
    .modal-fullscreen-body {
      padding: 24px;
      flex: 1 1 auto;
      overflow-y: auto;
      min-height: 0;
      -webkit-overflow-scrolling: touch;
    }

    /* TAB NAVIGATION */
    .tab-nav {
      display: flex;
      gap: 0;
      border-bottom: 2px solid #E2E8F0;
      margin-bottom: 24px;
      overflow-x: auto;
      flex-wrap: wrap;
    }
    .tab-nav button {
      padding: 12px 20px;
      background: transparent;
      color: #64748B;
      font-size: 14px;
      font-weight: 600;
      border: none;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      margin-bottom: -2px;
    }
    .tab-nav button.active {
      color: #1E3A5F;
      border-bottom-color: #1E3A5F;
    }
    .tab-nav button:hover {
      color: #0F172A;
    }

    /* TAB PANES */
    .tab-pane {
      display: none;
    }
    .tab-pane.active {
      display: block;
    }

    /* FORM GRID */
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 16px;
    }
    .form-row.full {
      grid-template-columns: 1fr;
    }

    /* CHECKBOX GRID */
    .checkbox-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }
    .checkbox-grid label {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 400;
      cursor: pointer;
      margin-bottom: 0;
    }
    .checkbox-grid input[type="checkbox"] {
      width: auto;
      margin: 0;
    }

    /* ====== MOBILE HAMBURGER ====== */
    .mobile-hamburger {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0;
      height: calc(56px + env(safe-area-inset-top, 0px));
      padding: env(safe-area-inset-top, 0px) 16px 0 16px;
      box-sizing: border-box;
      background: #0F172A;
      color: white;
      z-index: 999;
      align-items: center;
      gap: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .mobile-hamburger-btn {
      background: none; border: none; color: white;
      font-size: 22px; cursor: pointer; padding: 8px;
      display: flex; align-items: center; justify-content: center;
      width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 10px;
      -webkit-tap-highlight-color: transparent;
    }
    .mobile-hamburger-btn:active { background: rgba(255,255,255,0.1); }
    .mobile-hamburger-title {
      font-size: 16px; font-weight: 700; color: #F8FAFC;
      flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .mobile-hamburger-user {
      width: 32px; height: 32px; border-radius: 50%;
      background: #3B82F6; color: white; font-size: 12px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }
    .sidebar-overlay {
      display: none;
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.5);
      z-index: 999;
    }
    .sidebar-overlay.active { display: block; }

    /* ====== RESPONSIVE : TABLETTE (≤1024px) ====== */
    @media (max-width: 1024px) {
      .sidebar { width: 220px; }
      .sidebar-logo { padding: 20px 16px; font-size: 18px; }
      .sidebar-item { padding: 10px 16px; font-size: 13px; }
      .sidebar-section-title { padding: 0 16px 10px 16px; font-size: 10px; }
      #content { padding: 16px; }
      .app-topbar { padding: 12px 16px; }
      .stat-card { padding: 20px; }
      .stat-card-value { font-size: 28px; }
      .topbar { padding: 16px 24px; }
      .topbar-left { gap: 24px; }
    }

    /* ====== RESPONSIVE : iPad PORTRAIT (769-1024px) — sidebar en tiroir ====== */
    /* En portrait la grande sidebar tassait le contenu : on la passe en tiroir
       (hamburger) comme sur mobile. En paysage (>1024px) elle reste fixe. */
    @media (min-width: 769px) and (max-width: 1024px) {
      /* Menu lateral garde VISIBLE (docke) sur iPad paysage / petit ecran bureau.
         Avant : tiroir flottant qui sortait de l'interface. */
      .mobile-hamburger { display: none !important; }
      .sidebar-overlay { display: none !important; }
      body .app.active { padding-top: 0 !important; padding-bottom: 0 !important; }
      .sidebar {
        position: static; top: auto; bottom: auto; left: auto;
        width: 220px; z-index: auto;
        transition: none;
        overflow-y: auto;
        padding-bottom: 0 !important;
      }
      .sidebar.sidebar-open { left: auto; }
      .main-area { width: auto; flex: 1; }
      .mobile-bottom-nav { display: none !important; }
      #content { padding: 24px; }
    }

    /* ====== Fix crash iPad : ancrage du sélecteur photo ======
       Les <input type=file> masqués via style="display:none" et déclenchés
       par .click() n'ont pas de rectangle d'ancrage : sur iPad le popover
       "Prendre une photo / Photothèque" plante l'app. On les rend invisibles
       MAIS positionnés (1px) pour fournir un ancrage. Les inputs fichier
       VISIBLES (ex. pièce d'identité) ne sont pas concernés. */
    input[type="file"][style*="display:none"],
    input[type="file"][style*="display: none"] {
      display: inline-block !important;
      position: absolute !important;
      width: 1px !important; height: 1px !important;
      padding: 0 !important; margin: 0 !important;
      opacity: 0 !important; border: 0 !important;
      overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
    }

    /* Mobile bottom nav - caché par défaut (desktop), visible dans media query mobile */
    .mobile-bottom-nav { display: none !important; }

    /* ====== RESPONSIVE : MOBILE (≤768px) ====== */
    @media (max-width: 768px) {
      /* Landing page — barre de navigation compacte sur une seule ligne */
      .topbar { flex-direction: row; gap: 8px; padding: 10px 14px; justify-content: space-between; align-items: center; }
      .topbar-left { gap: 0; flex: 1; min-width: 0; }
      .topbar-nav { display: none; }
      .topbar-right { flex-direction: row; gap: 6px; flex-shrink: 0; }
      .topbar-right .btn-outline { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
      .topbar-right .btn-primary { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
      .hero { padding: 32px 16px; }
      .hero h1 { font-size: 28px; }
      .hero p { font-size: 15px; }
      .hero-buttons { flex-direction: column; align-items: center; }
      .hero-buttons .btn-white, .hero-buttons .btn-outline { width: 100%; max-width: 280px; text-align: center; }
      .features-grid { grid-template-columns: 1fr; }
      .feature-card { padding: 20px; }
      .pricing-grid { grid-template-columns: 1fr; }
      .pricing-card { padding: 24px; }
      .form-row { grid-template-columns: 1fr; }
      .checkbox-grid { grid-template-columns: repeat(2, 1fr); }

      /* App layout */
      .mobile-hamburger { display: flex; }
      .app.active { padding-top: 56px; }
      .sidebar {
        position: fixed; top: 0; bottom: 0; left: -280px;
        width: 260px; z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px !important;
      }
      .sidebar.sidebar-open { left: 0; }
      .main-area { width: 100%; }

      /* Topbar app */
      .app-topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
      .app-topbar-right { gap: 8px; flex-wrap: wrap; }
      .breadcrumb { font-size: 13px; }
      .search-input { width: 100%; max-width: 100%; }

      /* Content */
      #content { padding: 12px; }

      /* Stats */
      .grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
      .stat-card { padding: 14px; min-width: unset !important; }
      .stat-card-value { font-size: 22px; }
      .stat-card-label { font-size: 11px; }

      /* Tableaux */
      table { font-size: 13px; }
      th, td { padding: 8px 10px; }
      .hide-mobile { display: none !important; }

      /* Modals */
      .modal-content { width: 95% !important; max-width: 95vw !important; padding: 16px !important; }
      .modal-fullscreen-content { width: 98% !important; max-width: 98vw !important; padding: 16px !important; }
      .modal-header h2, .modal-header h3 { font-size: 18px; }

      /* Boutons & actions */
      .topbar-actions { flex-wrap: wrap; gap: 6px; }
      .topbar-actions .btn { font-size: 12px; padding: 8px 12px; }

      /* Menu Ajouter */
      #menuAjouterDropdown { left: 0 !important; right: 0 !important; }

      /* Cartes biens/locataires */
      .letters-grid { grid-template-columns: 1fr !important; }

      /* Formulaires inline */
      .form-group { margin-bottom: 12px; }
      .form-group label { font-size: 13px; }
      .form-group input, .form-group select, .form-group textarea { font-size: 14px; }

      /* SCI selector */
      .sci-selector { width: 100%; }

      /* User menu */
      .user-section { position: relative; }
      .user-menu { right: 0; min-width: 200px; }

      /* Charts */
      canvas { max-width: 100%; height: auto !important; }

      /* Envoi rapide - action buttons */
      .envoi-rapide-actions { flex-wrap: wrap; gap: 6px; }

      /* Mobile bottom nav */
      .mobile-bottom-nav {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
        background: #fff; border-top: 1px solid #E2E8F0;
        display: flex !important; justify-content: space-around; align-items: center;
        height: auto;
        min-height: 56px;
        padding: 4px 0 env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
      }
      .mobile-bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; padding: 6px 0; flex: 1; cursor: pointer;
        color: #94A3B8; transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
      }
      .mobile-bottom-nav-item i { font-size: 18px; }
      .mobile-bottom-nav-item span { font-size: 11px; font-weight: 500; }
      .mobile-bottom-nav-item.active { color: #1E3A5F; }
      .mobile-bottom-nav-item.active i { color: #C9A227; }
      .mobile-bottom-nav-item:active { color: #1E3A5F; }

      /* Padding bottom for content to avoid overlap with bottom nav */
      /* padding-bottom géré une seule fois sur .app.active — éviter double trou blanc */
      .main-area { padding-bottom: 0 !important; }

      /* Profil page — mobile responsive */
      .profil-card { padding: 16px !important; }
      .profil-header { flex-wrap: wrap; gap: 12px !important; margin-bottom: 20px !important; }
      .profil-header .profil-avatar { width: 60px !important; height: 60px !important; font-size: 22px !important; }
      .profil-actions { flex-direction: column !important; gap: 8px !important; }
      .profil-actions .btn { width: 100% !important; text-align: center; }
      .profil-type-selector { flex-direction: column !important; }
      .profil-type-selector label { flex: none !important; width: 100% !important; box-sizing: border-box !important; overflow: hidden !important; }
      .profil-type-selector label input[type="radio"] { width: 20px !important; height: 20px !important; min-width: 20px !important; flex-shrink: 0 !important; accent-color: #1E3A5F; }
      .profil-type-selector label i { flex-shrink: 0 !important; }
      .profil-type-selector label span.profil-type-label { flex: 1 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

    }

    /* ===== ENVOI RAPIDE — Boutons d'action colorés ===== */
    .er-row {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 14px; border: 1px solid #F1F5F9;
      border-radius: 12px; margin-bottom: 8px; flex-wrap: wrap;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .er-row:hover { border-color: #CBD5E1; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
    .er-info { flex: 1; min-width: 150px; }
    .er-nom { font-weight: 700; font-size: 14px; color: #0F172A; }
    .er-bien { font-size: 12px; color: #64748B; margin-top: 2px; }
    .er-montant { font-weight: 600; color: #1E3A5F; }
    .er-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .er-btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 13px; border-radius: 999px; border: 1px solid;
      cursor: pointer; font-size: 12px; font-weight: 500;
      min-height: 32px; background: white;
      transition: background 0.15s, opacity 0.15s;
      white-space: nowrap;
    }
    .er-btn i { font-size: 12px; }
    .er-btn:hover { opacity: 0.82; }
    .er-btn:active { opacity: 0.65; }
    /* Envoyer — violet pastel (comme Avis locataires) */
    .er-avis { background: #EDE9FE; color: #6D28D9; border-color: #C4B5FD; }
    .er-avis:hover { background: #DDD6FE; }
    /* Paiement — vert pastel */
    .er-paiement { background: #D1FAE5; color: #047857; border-color: #6EE7B7; }
    .er-paiement:hover { background: #A7F3D0; }
    /* Charge — orange pastel */
    .er-charge { background: #FFF7ED; color: #C2410C; border-color: #FDBA74; }
    .er-charge:hover { background: #FED7AA; }
    /* Quittance — bleu pastel (comme Quitt. locataires) */
    .er-quittance { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
    .er-quittance:hover { background: #BFDBFE; }

    .er-fonciere { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
    .er-fonciere:hover { background: #FDE68A; }
    .er-tarif { background: #EEF2FF; color: #3730A3; border-color: #A5B4FC; }
    .er-tarif:hover { background: #E0E7FF; }
    .er-dette { background: #FEF2F2; color: #DC2626; border-color: #FCA5A5; }
    .er-dette:hover { background: #FEE2E2; }
    /* Quittance verrouillée */
    .er-locked { background: #F8FAFC; border-color: #E2E8F0; color: #CBD5E1; cursor: not-allowed; }
    .er-locked:hover { background: #F8FAFC; opacity: 1; }
    .er-badge {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 6px 12px; border-radius: 999px; border: 1px solid;
      font-size: 12px; font-weight: 500; min-height: 32px; cursor: default;
    }
    .er-badge i { font-size: 12px; }
    .er-done { background: #F0FDF4; color: #16A34A; border-color: #BBF7D0; }

    /* ====== IA CHAT ====== */
    .ia-msg { display: flex; align-items: flex-start; gap: 10px; }
    .ia-bot { flex-direction: row; }
    .ia-user { flex-direction: row-reverse; }
    .ia-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#8B5CF6,#6D28D9); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
    .ia-bubble { background: #F1F5F9; border-radius: 12px; padding: 12px 16px; font-size: 14px; color: #1E293B; line-height: 1.6; max-width: 80%; }
    .ia-bubble-user { background: linear-gradient(135deg,#8B5CF6,#6D28D9); color: white; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.6; max-width: 80%; }

    @media (max-width: 640px) {
      .er-row { flex-direction: column; align-items: stretch; padding: 14px; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
      .er-info { min-width: 0; }
      .er-nom { font-size: 15px; }
      .er-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
      .er-btn, .er-badge { flex-direction: row; gap: 8px; padding: 12px 14px; font-size: 12px; min-width: 0; width: 100%; justify-content: flex-start; }
      .er-btn i, .er-badge i { font-size: 18px; }
    }

    /* ====== RESPONSIVE : PETIT MOBILE (≤480px) ====== */
    @media (max-width: 480px) {
      .hero h1 { font-size: 24px; }
      .hero p { font-size: 14px; }
      #content { padding: 8px; }
      .grid-4 { grid-template-columns: 1fr !important; }
      .stat-card-value { font-size: 20px; }
      .stat-card { padding: 12px; }
      .app-topbar { padding: 8px 10px; }
      .breadcrumb { font-size: 12px; }
      th, td { padding: 6px 8px; font-size: 12px; }
      .modal-content { padding: 12px !important; }
      .sidebar-logo { padding: 16px 14px; }
      .checkbox-grid { grid-template-columns: 1fr; }
      .topbar-actions .btn { width: 100%; text-align: center; font-size: 12px; }
    }

    /* Touch-friendly */
    button, .btn, .sidebar-item, a { touch-action: manipulation; }
    @media (hover: none) and (pointer: coarse) {
      .sidebar-item { padding: 14px 20px; }
      .btn { min-height: 44px; }
    }

    /* ===== Utility classes (extracted from inline styles) ===== */
    .admin-bar { background:linear-gradient(135deg,#1E293B,#334155); border-radius:12px; padding:16px 20px; margin-bottom:20px; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
    .admin-bar-title { color:white; font-weight:700; font-size:14px; margin-right:8px; }
    .btn-export-excel { padding:9px 16px; font-size:13px; background:#10B981; color:white; border:none; border-radius:8px; cursor:pointer; font-weight:600; }
    .btn-export-json { padding:9px 16px; font-size:13px; background:#8B5CF6; color:white; border:none; border-radius:8px; cursor:pointer; font-weight:600; }
    .btn-import-excel { padding:9px 16px; font-size:13px; background:#F59E0B; color:#1E293B; border:none; border-radius:8px; cursor:pointer; font-weight:700; display:inline-flex; align-items:center; }
    .btn-import-json { padding:9px 16px; font-size:13px; background:#EF4444; color:white; border:none; border-radius:8px; cursor:pointer; font-weight:700; display:inline-flex; align-items:center; }
    .stat-card { color:white; padding:16px 24px; border-radius:12px; flex:1; min-width:120px; text-align:center; }
    .stat-card-value { font-size:28px; font-weight:700; }
    .stat-card-label { font-size:12px; opacity:.8; }
    .data-table { width:100%; border-collapse:collapse; }
    .data-table th { padding:14px 16px; text-align:left; font-size:12px; color:#64748B; text-transform:uppercase; }
    .data-table td { padding:12px 16px; }
    .action-btn { border:none; padding:5px 8px; border-radius:6px; cursor:pointer; font-size:11px; margin-right:2px; color:white; }
    .action-btn-view { background:#1E3A5F; }
    .action-btn-excel { background:#10B981; }
    .action-btn-json { background:#8B5CF6; }
    .action-btn-import-xl { background:#F59E0B; color:#1E293B; }
    .action-btn-import-js { background:#EF4444; }

    /* Page transition */
    #content { transition: opacity 0.2s ease; }
    #content.page-loading { opacity: 0; }

    /* Form validation */
    .form-group input:invalid:not(:placeholder-shown),
    .form-group select:invalid:not(:placeholder-shown) {
      border-color: #EF4444;
      box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
    }
    .form-error { color: #EF4444; font-size: 12px; margin-top: 4px; display: none; }
    .form-group.has-error .form-error { display: block; }
    .form-group.has-error input,
    .form-group.has-error select { border-color: #EF4444; }

    /* Loading skeleton */
    .skeleton { background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    /* Custom confirm modal */
    .confirm-overlay { position:fixed; inset:0; background:rgba(15,23,42,0.42); display:flex; align-items:center; justify-content:center; z-index:30000; backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
    .confirm-box { background:white; border-radius:12px; padding:28px; max-width:400px; width:90%; box-shadow:0 20px 60px rgba(0,0,0,0.3); text-align:center; }
    .confirm-box h3 { font-size:18px; font-weight:700; margin-bottom:12px; color:#0F172A; }
    .confirm-box p { font-size:14px; color:#64748B; margin-bottom:24px; }
    .confirm-box .confirm-actions { display:flex; gap:12px; justify-content:center; }
    .confirm-box .confirm-btn { padding:10px 24px; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; border:none; transition:all 0.2s; }
    .confirm-box .confirm-cancel { background:#F1F5F9; color:#64748B; }
    .confirm-box .confirm-cancel:hover { background:#E2E8F0; }
    .confirm-box { border: 1px solid rgba(30,58,95,0.08); box-shadow: 0 20px 50px rgba(30,58,95,0.18) !important; }
    .confirm-box .confirm-ok { background:#1E3A5F; color:white; box-shadow: inset 0 -2px 0 #C9A227; }
    .confirm-box .confirm-ok:hover { background:#16293F; }
    .confirm-box .confirm-ok.danger { background:#DC2626; box-shadow: none; }
    .confirm-box .confirm-ok.danger:hover { background:#B91C1C; }

    /* Page transition */
    #content { transition: opacity 0.15s ease; }
    #content.page-exit { opacity: 0; }

    /* Landing page animations */
    @keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
    .animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
    .animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
    .animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
    .animate-delay-3 { animation-delay: 0.3s; opacity: 0; }

    .stats-bar { background: #0F172A; padding: 48px 40px; display: flex; justify-content: center; gap: 60px; flex-wrap: wrap; }
    .stats-bar-item { text-align: center; color: white; }
    .stats-bar-number { font-size: 36px; font-weight: 800; color: #1E3A5F; }
    .stats-bar-label { font-size: 14px; color: #CBD5E1; }

    .testimonials { padding: 80px 40px; background: #FFFFFF; }
    .testimonials h2 { text-align: center; font-size: 36px; font-weight: 800; margin-bottom: 48px; color: #0F172A; }
    .testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
    .testimonial-card { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 28px; position: relative; }
    .testimonial-card::before { content: '\201C'; font-size: 48px; color: #1E3A5F; font-family: Georgia, serif; position: absolute; top: 12px; left: 20px; }
    .testimonial-text { font-size: 14px; color: #475569; line-height: 1.7; margin-bottom: 16px; padding-top: 24px; }
    .testimonial-author { display: flex; align-items: center; gap: 12px; }
    .testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1E3A5F, #16293F); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
    .testimonial-name { font-size: 14px; font-weight: 600; color: #0F172A; }
    .testimonial-role { font-size: 12px; color: #64748B; }

    .faq { padding: 80px 40px; background: #F8FAFC; }
    .faq h2 { text-align: center; font-size: 36px; font-weight: 800; margin-bottom: 48px; color: #0F172A; }
    .faq-grid { max-width: 800px; margin: 0 auto; }
    .faq-item { background: white; border: 1px solid #E2E8F0; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
    .faq-question { padding: 18px 24px; font-size: 15px; font-weight: 600; color: #0F172A; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
    .faq-question:hover { background: #F8FAFC; }
    .faq-question::after { content: '+'; font-size: 20px; color: #1E3A5F; font-weight: 700; }
    .faq-item.open .faq-question::after { content: '-'; }
    .faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 24px; font-size: 14px; color: #64748B; line-height: 1.7; }
    .faq-item.open .faq-answer { max-height: 400px; padding: 0 24px 18px; }

    /* EXCEL VS MANAGIMMO */
    /* Annonces generator layout */
    @media (max-width: 720px) {
      .annonces-layout { grid-template-columns: 1fr !important; }
    }

    .excel-section { background: #F8FAFC; padding: 80px 40px; text-align: center; }
    .excel-tag { display: inline-block; background: #FEF3C7; color: #92400E; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; padding: 4px 14px; border-radius: 20px; margin-bottom: 16px; text-transform: uppercase; }
    .excel-section h2 { font-size: 36px; font-weight: 800; color: #0F172A; margin-bottom: 12px; }
    .excel-subtitle { font-size: 16px; color: #64748B; max-width: 620px; margin: 0 auto 48px; line-height: 1.6; }
    .excel-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; max-width: 900px; margin: 0 auto 40px; align-items: center; }
    .excel-card { background: white; border-radius: 16px; padding: 28px; text-align: left; }
    .excel-bad { border: 2px solid #FEE2E2; }
    .excel-good { border: 2px solid #D1FAE5; box-shadow: 0 8px 32px rgba(16,185,129,0.12); }
    .excel-card-header { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #F1F5F9; }
    .excel-bad .excel-card-header { color: #DC2626; }
    .excel-good .excel-card-header { color: #059669; }
    .excel-bad .excel-card-header i, .excel-good .excel-card-header i { font-size: 18px; }
    .excel-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
    .excel-card ul li { font-size: 14px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
    .excel-bad li { color: #64748B; }
    .excel-good li { color: #1E293B; font-weight: 500; }
    .excel-bad li i { color: #EF4444; font-size: 15px; flex-shrink: 0; margin-top: 1px; }
    .excel-good li i { color: #10B981; font-size: 15px; flex-shrink: 0; margin-top: 1px; }
    .excel-arrow { font-size: 28px; color: #CBD5E1; }
    .excel-cta { font-size: 16px; padding: 14px 32px; }
    @media (max-width: 768px) {
      .excel-section { padding: 60px 20px; }
      .excel-section h2 { font-size: 26px; }
      .excel-grid { grid-template-columns: 1fr; gap: 16px; }
      .excel-arrow { transform: rotate(90deg); }
    }

    .cta-section { background: linear-gradient(135deg, #1E3A5F 0%, #16293F 50%, #101E2E 100%); padding: 80px 40px; text-align: center; color: white; }
    .cta-section h2 { font-size: 32px; font-weight: 800; margin-bottom: 16px; }
    .cta-section p { font-size: 16px; opacity: 0.9; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

    @media (max-width: 768px) {
      .stats-bar { gap: 30px; padding: 32px 20px; }
      .stats-bar-number { font-size: 28px; }
      .testimonials { padding: 48px 16px; }
      .testimonials-grid { grid-template-columns: 1fr; }
      .faq { padding: 48px 16px; }
      .cta-section { padding: 48px 20px; }
      .cta-section h2 { font-size: 24px; }
    }

    /* ═══════════════════════════════════════════════════════════════
       ACCESSIBILITÉ — Focus visible, Skip nav, Contrastes WCAG AA
       ═══════════════════════════════════════════════════════════════ */

    /* Skip to content link (keyboard users) */
    .skip-to-content {
      position: absolute;
      top: -100px;
      left: 16px;
      background: #1E3A5F;
      color: white;
      padding: 12px 24px;
      border-radius: 0 0 8px 8px;
      font-size: 14px;
      font-weight: 600;
      z-index: 10000;
      transition: top 0.2s;
    }
    .skip-to-content:focus {
      top: 0;
      outline: 3px solid #F59E0B;
      outline-offset: 2px;
    }

    /* Focus visible global — ring bleu visible uniquement au clavier */
    *:focus-visible {
      outline: 2px solid #1E3A5F;
      outline-offset: 2px;
    }
    /* Retirer outline mouse click mais garder focus-visible keyboard */
    *:focus:not(:focus-visible) {
      outline: none;
    }
    /* Form inputs : garder le ring au focus */
    .form-group input:focus-visible,
    .form-group textarea:focus-visible,
    .form-group select:focus-visible {
      outline: 2px solid #1E3A5F;
      outline-offset: 0;
      border-color: #1E3A5F;
      box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
    }
    /* Buttons focus */
    .btn-primary:focus-visible,
    .btn-outline:focus-visible,
    button:focus-visible {
      outline: 2px solid #1E3A5F;
      outline-offset: 2px;
      box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.2);
    }
    /* Sidebar links focus */
    .sidebar a:focus-visible,
    .sidebar button:focus-visible {
      outline: 2px solid #38BDF8;
      outline-offset: -2px;
      border-radius: 4px;
    }
    /* Tab focus */
    .tab-btn:focus-visible {
      outline: 2px solid #1E3A5F;
      outline-offset: -2px;
    }

    /* Trap focus in modal (visual indicator) */
    .modal:focus-visible,
    .modal-content:focus-visible {
      outline: none;
    }

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

    /* ═══════════════════════════════════════════════════════════════
       ANIMATIONS — Landing page + transitions globales
       ═══════════════════════════════════════════════════════════════ */

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

    /* Smooth scroll */
    html { scroll-behavior: smooth; }

    /* Feature cards hover animation */
    .feature-card {
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .feature-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    }

    /* Pricing cards hover */
    .pricing-card {
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .pricing-card:hover {
      transform: translateY(-6px);
      box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    }

    /* Stat cards subtle pulse on hover */
    .stat-card {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .stat-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    /* Smooth page transitions */
    #mainContent {
      animation: fadeIn 0.2s ease;
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    /* Button press effect */
    .btn-primary:active, .btn-outline:active {
      transform: scale(0.97);
    }

    /* Loading spinner for async actions */
    .btn-loading {
      position: relative;
      pointer-events: none;
      opacity: 0.8;
    }
    .btn-loading::after {
      content: '';
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
    }
    @keyframes spin {
      to { transform: translateY(-50%) rotate(360deg); }
    }

    /* Toast notification animation */
    .toast-notification {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: rgba(255,255,255,0.97);
      color: #1E293B;
      padding: 14px 18px;
      border-radius: 14px;
      font-size: 14px;
      font-weight: 500;
      z-index: 99999;
      box-shadow: 0 12px 32px rgba(30,58,95,0.12);
      border: 1px solid rgba(30,58,95,0.08);
      animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
      display: flex;
      align-items: center;
      gap: 10px;
      max-width: 400px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .toast-notification .fas { color: #1E3A5F; flex-shrink: 0; }
    .toast-notification.success { border-left: 3px solid #10B981; }
    .toast-notification.success .fas { color: #059669; }
    .toast-notification.error { border-left: 3px solid #DC2626; }
    .toast-notification.error .fas { color: #DC2626; }
    .toast-notification.warning { border-left: 3px solid #F59E0B; }
    .toast-notification.warning .fas { color: #D97706; }
    .toast-notification.info { border-left: 3px solid #C9A227; }
    .toast-notification.info .fas { color: #C9A227; }
    @media (max-width: 768px) {
      .toast-notification {
        left: 12px; right: 12px; bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px));
        max-width: none;
      }
    }
    @keyframes slideInRight {
      from { transform: translateX(100%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }
    @keyframes fadeOut {
      to { opacity: 0; transform: translateY(10px); }
    }

    /* ═══════════════════════════════════════════════════════════════
       DARK MODE (system preference)
       ═══════════════════════════════════════════════════════════════ */
    @media (prefers-color-scheme: dark) {
      body.dark-mode-auto {
        background: #0F172A;
        color: #E2E8F0;
      }
    }
    /* Manual dark mode toggle class */
    body.dark-mode .landing,
    body.dark-mode .topbar { background: #1E293B; }
    body.dark-mode .sidebar { background: #0F172A; }
    body.dark-mode .main-content { background: #0F172A; color: #E2E8F0; }
    body.dark-mode .form-group input,
    body.dark-mode .form-group textarea,
    body.dark-mode .form-group select {
      background: #1E293B; border-color: #334155; color: #E2E8F0;
    }
    body.dark-mode .modal-content { background: #1E293B; color: #E2E8F0; }
    body.dark-mode .stat-card { background: #1E293B; border-color: #334155; }
    body.dark-mode .tab-btn { color: #94A3B8; }
    body.dark-mode .tab-btn.active { color: #38BDF8; border-bottom-color: #38BDF8; }

    /* ═══════════════════════════════════════════════════════════════
       PRINT STYLES
       ═══════════════════════════════════════════════════════════════ */
    @media print {
      .sidebar, .topbar, .landing, .bottom-nav, #installBanner,
      .modal, button, .btn-primary, .btn-outline, .topbar-right,
      .sidebar-toggle, .fab-button { display: none !important; }
      .app-container { grid-template-columns: 1fr !important; }
      .main-content { padding: 0 !important; }
      body { background: white !important; color: black !important; font-size: 12pt; }
      * { box-shadow: none !important; }
      a { color: #1E3A5F !important; text-decoration: underline !important; }
      .stat-card { border: 1px solid #ccc !important; break-inside: avoid; }
      table { border-collapse: collapse; }
      table th, table td { border: 1px solid #ccc; padding: 8px; }
      @page { margin: 2cm; }
    }

    /* ═══════════════════════════════════════════════════════════════
       UX — Inline validation, Loading states, Better form feedback
       ═══════════════════════════════════════════════════════════════ */

    /* Form validation feedback */
    .form-group input:invalid:not(:placeholder-shown) {
      border-color: #EF4444;
    }
    .form-group input:valid:not(:placeholder-shown):not([type="text"]) {
      border-color: #10B981;
    }
    .form-error {
      color: #EF4444;
      font-size: 12px;
      margin-top: 4px;
      display: none;
    }
    .form-group input:invalid:not(:placeholder-shown) ~ .form-error {
      display: block;
    }

    /* Better select styling */
    .form-group select {
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 36px;
    }

    /* Smooth modal transitions */
    .modal {
      transition: opacity 0.2s ease;
    }
    .modal-content {
      transition: transform 0.2s ease;
    }

    /* Empty state styling */
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: #64748B;
    }
    .empty-state i {
      font-size: 48px;
      color: #CBD5E1;
      margin-bottom: 16px;
      display: block;
    }
    .empty-state p {
      font-size: 15px;
      margin-bottom: 20px;
    }

    /* Tooltip */
    [data-tooltip] {
      position: relative;
    }
    [data-tooltip]::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%);
      background: #0F172A;
      color: white;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 12px;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s;
      z-index: 1000;
    }
    [data-tooltip]:hover::after {
      opacity: 1;
    }

    /* Scrollbar styling */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
    .sidebar::-webkit-scrollbar-thumb { background: #334155; }
    .sidebar::-webkit-scrollbar-thumb:hover { background: #475569; }

    /* ═══════════════════════════════════════════════════════════════
       RESPONSIVE MOBILE AVANCÉ — Breakpoints 320/480/640/768/1024
       ═══════════════════════════════════════════════════════════════ */

    /* ── Tablette paysage (< 1024px) ── */
    @media (max-width: 1024px) {
      .topbar { padding: 12px 20px; }
      .topbar-nav { gap: 20px; }
      .hero { padding: 60px 20px; }
      .hero h1 { font-size: 36px; }
      .features { padding: 60px 20px; }
      .pricing { padding: 60px 20px; }
      .stats-bar { gap: 40px; padding: 36px 20px; }
      .main-content { padding: 16px; }
    }

    /* ── Tablette portrait (< 768px) ── */
    @media (max-width: 768px) {
      .hero h1 { font-size: 28px; line-height: 1.3; }
      .hero p { font-size: 15px; }
      .features-grid { grid-template-columns: 1fr; gap: 16px; }
      .feature-card { padding: 20px; }
      .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
      .stats-bar { flex-direction: column; gap: 20px; }
      .app-topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
      .search-input { min-width: 180px !important; font-size: 16px !important; }
      .breadcrumb { font-size: 12px; }
      h1 { font-size: 22px !important; }
      h2 { font-size: 18px !important; }
      h3 { font-size: 16px !important; }
      .form-row { flex-direction: column; gap: 0; }
      .form-group input, .form-group textarea, .form-group select { font-size: 16px; padding: 12px; }
      .modal-content { width: 95% !important; max-width: 95% !important; margin: 10px; padding: 16px !important; max-height: 90vh; overflow-y: auto; }
      table { font-size: 13px; }
      table th, table td { padding: 8px 6px !important; }
      .stat-card { padding: 16px; }
      .stat-card h3 { font-size: 13px; }
      .letters-grid { grid-template-columns: 1fr; }
      .tabs-header { gap: 0; }
      .tab-btn { padding: 10px 12px; font-size: 12px; }
    }

    /* ── Mobile large (< 640px) ── */
    @media (max-width: 640px) {
      .hero { padding: 40px 16px; min-height: auto; }
      .hero h1 { font-size: 24px; }
      .btn-primary, .btn-outline { padding: 10px 16px; font-size: 13px; }
      .logo { font-size: 18px; }
      .testimonials-grid { grid-template-columns: 1fr; }
      .faq-question { padding: 14px 16px; font-size: 14px; }
      .faq-answer { padding: 0 16px; }
      .cta-section h2 { font-size: 22px; }
      .cta-section p { font-size: 14px; }
      .app-topbar-right { flex-wrap: wrap; }
      .sidebar-item { padding: 10px 16px; font-size: 13px; }
      .stat-card { min-width: 100%; }
    }

    /* ── Mobile petit (< 480px) ── */
    @media (max-width: 480px) {
      body { font-size: 14px; }
      .hero h1 { font-size: 22px; }
      .hero-buttons { flex-direction: column; gap: 10px; }
      .hero-buttons .btn-primary, .hero-buttons .btn-outline { width: 100%; text-align: center; }
      .topbar { padding: 8px 12px; }
      .topbar-right { gap: 8px; }
      .search-input { min-width: 0 !important; width: 100% !important; }
      #globalSearchResults { max-height: 300px; }
      .form-group label { font-size: 13px; }
      .modal-content { padding: 12px !important; }
      .modal-content h2 { font-size: 16px !important; }
      .stat-card .stat-value { font-size: 24px; }
      .pricing-price { font-size: 28px; }
    }

    /* ── Micro mobile (< 360px) ── */
    @media (max-width: 360px) {
      .hero h1 { font-size: 20px; }
      .btn-primary { padding: 8px 10px; font-size: 12px; }
      .tab-btn { padding: 8px 6px; font-size: 11px; }
      .topbar-right .btn-outline { padding: 7px 8px; font-size: 12px; }
      .topbar-right .btn-primary { padding: 7px 8px; font-size: 12px; }
      .logo { font-size: 17px; }
    }

    /* ── Modals plein écran sur mobile ── */
    @media (max-width: 480px) {
      .modal { align-items: flex-end; padding: 0; }
      .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
      }
    }

    /* ── Touch device improvements ── */
    @media (hover: none) and (pointer: coarse) {
      button, .btn-primary, .btn-outline, .sidebar-item, .tab-btn, a[onclick] {
        min-height: 44px;
        min-width: 44px;
      }
      .sidebar-item { padding: 14px 20px; }
      .tab-btn { padding: 14px 16px; }
      input, select, textarea { font-size: 16px !important; }
      .feature-card:hover, .pricing-card:hover, .stat-card:hover {
        transform: none;
      }
    }

    /* ═══════════════════════════════════════════════════════════════
       ACCESSIBILITÉ AVANCÉE — WCAG 2.1 AA+
       ═══════════════════════════════════════════════════════════════ */

    /* High contrast mode support */
    @media (forced-colors: active) {
      .btn-primary, .btn-outline { border: 2px solid ButtonText; }
      .stat-card, .feature-card { border: 1px solid ButtonText; }
      .sidebar-item.active { border-left: 3px solid Highlight; }
    }

    /* Minimum text size for readability */
    p, span, td, th, label, li { min-height: 1em; }

    /* Better link visibility */
    .main-content a:not(.btn-primary):not(.btn-outline):not([onclick]) {
      text-decoration: underline;
      text-decoration-color: #1E3A5F20;
      text-underline-offset: 2px;
    }
    .main-content a:not(.btn-primary):not(.btn-outline):not([onclick]):hover {
      text-decoration-color: #1E3A5F;
    }

    /* Disabled state clearly visible */
    button:disabled, input:disabled, select:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      filter: grayscale(0.3);
    }

    /* Error state for required fields */
    input:required:invalid:not(:placeholder-shown):not(:focus) {
      border-color: #EF4444;
      box-shadow: 0 0 0 1px #EF444420;
    }
    input:required:valid:not(:placeholder-shown):not([type="text"]):not(:focus) {
      border-color: #10B981;
    }

    /* ═══════════════════════════════════════════════════════════════
       VALIDATION FORMULAIRES AVANCÉE
       ═══════════════════════════════════════════════════════════════ */

    .form-group { position: relative; }
    .form-group .validation-msg {
      font-size: 12px;
      margin-top: 4px;
      display: none;
      align-items: center;
      gap: 4px;
    }
    .form-group .validation-msg.error { color: #EF4444; }
    .form-group .validation-msg.success { color: #10B981; }
    .form-group input:invalid:not(:placeholder-shown):not(:focus) ~ .validation-msg.error { display: flex; }
    .form-group input:valid:not(:placeholder-shown) ~ .validation-msg.success { display: flex; }

    /* Password strength indicator */
    .password-strength { height: 4px; border-radius: 2px; background: #E2E8F0; margin-top: 6px; overflow: hidden; }
    .password-strength-bar { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }
    .password-strength-bar.weak { width: 25%; background: #EF4444; }
    .password-strength-bar.medium { width: 50%; background: #F59E0B; }
    .password-strength-bar.strong { width: 75%; background: #1E3A5F; }
    .password-strength-bar.very-strong { width: 100%; background: #10B981; }

    /* Character counter */
    .char-counter { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: #94A3B8; pointer-events: none; }
    .char-counter.limit { color: #EF4444; }

    /* ═══════════════════════════════════════════════════════════════
       PERFORMANCE — Contain, will-change, content-visibility
       ═══════════════════════════════════════════════════════════════ */

    /* Layout containment for performance */
    .sidebar { contain: layout style; }
    .main-content { contain: style; }
    .stat-card, .feature-card, .pricing-card, .testimonial-card {
      contain: layout style paint;
    }

    /* Defer rendering of off-screen content */
    .tab-content:not(.active) { content-visibility: hidden; }

    /* GPU acceleration for animations */
    .modal-content, .toast-notification, .sidebar {
      will-change: transform;
    }

    /* Optimize table rendering */
    table { table-layout: fixed; }

    /* Image optimization */
    img { content-visibility: auto; }

    /* Reduce layout thrashing */
    .stat-value { contain: layout; }


    /* ====================================================
       APP MOBILE REDESIGN v2 — Ergonomie native iOS/Android
       ==================================================== */

    /* ── Safe-area reset & global mobile base ── */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
      .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom) !important; }
      .app.active { padding-bottom: calc(56px + 12px + env(safe-area-inset-bottom, 0px)) !important; }
    }

    /* ── Bottom Tab Bar (redesign) ── */
    @media (max-width: 768px) {
      .mobile-bottom-nav {
        position: fixed !important; bottom: 0; left: 0; right: 0;
        z-index: 9999;
        background: rgba(255,255,255,0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(30,58,95,0.08);
        display: flex !important;
        height: auto;
        min-height: 56px;
        padding: 2px 0 env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        box-shadow: 0 -6px 20px rgba(30,58,95,0.08);
      }
      .mobile-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
        color: #94A3B8;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.18s;
        padding-top: 6px;
      }
      .mobile-bottom-nav-item i {
        font-size: 20px;
        transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), color 0.18s;
      }
      .mobile-bottom-nav-item span {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.01em;
        line-height: 1.1;
        max-width: 72px;
        text-align: center;
        transition: color 0.18s;
      }
      .mobile-bottom-nav-item.active {
        color: #1E3A5F;
      }
      .mobile-bottom-nav-item.active i {
        transform: translateY(-2px) scale(1.1);
        color: #C9A227;
      }
      .mobile-bottom-nav-item.active span {
        color: #1E3A5F;
        font-weight: 700;
      }
      .mobile-bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 32px; height: 3px;
        background: linear-gradient(90deg, #C9A227, #E8C547);
        border-radius: 0 0 4px 4px;
        box-shadow: 0 1px 4px rgba(201,162,39,0.45);
      }
      .mobile-bottom-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 8px; left: 50%;
        transform: translateX(-50%);
        width: 4px; height: 4px;
        background: #C9A227;
        border-radius: 50%;
        opacity: 0.9;
      }
      .mobile-bottom-nav-item {
        min-height: 56px;
        min-width: 56px;
      }
      .mobile-bottom-nav-item:active i {
        transform: translateY(-1px) scale(0.92);
      }
      /* Active dot badge on tab */
      .mobile-bottom-nav-item .tab-badge {
        position: absolute;
        top: 6px; right: calc(50% - 16px);
        background: #EF4444;
        color: white;
        font-size: 9px;
        font-weight: 700;
        width: 16px; height: 16px;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        border: 2px solid white;
      }

      /* ── Mobile App Header redesign ── */
      .mobile-hamburger {
        height: calc(56px + env(safe-area-inset-top, 0px)) !important;
        background: linear-gradient(90deg, #0F172A, #1E293B) !important;
        padding: env(safe-area-inset-top, 0px) 16px 0 12px !important;
        gap: 10px !important;
        box-sizing: border-box !important;
        box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 12px rgba(0,0,0,0.25) !important;
      }
      .mobile-hamburger-title {
        font-size: 17px !important;
        font-weight: 700 !important;
        letter-spacing: -0.3px;
        color: #F8FAFC !important;
      }
      .mobile-hamburger-user {
        width: 34px !important; height: 34px !important;
        border-radius: 50%;
        border: 2px solid rgba(30, 58, 95,0.5);
        font-size: 13px !important;
      }
      .app.active { padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important; padding-bottom: calc(56px + 12px + env(safe-area-inset-bottom, 0px)) !important; }

      /* ── App topbar hidden on mobile (replaced by hamburger header) ── */
      .app-topbar { display: none !important; }

      /* ── Remove table min-width constraint on mobile ── */
      table { min-width: 0 !important; }
      .table-container { border-radius: 0; border-left: 0; border-right: 0; margin: 0 -12px 16px !important; width: calc(100% + 24px) !important; }

      /* ── Content area ── */
      #content { padding: 12px 14px 8px !important; overflow-x: hidden; }

      /* ── Cards mobile ── */
      .stat-card {
        padding: 16px 14px !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
      }
      .stat-card-value { font-size: 22px !important; }
      .stat-card-label { font-size: 11px !important; }

      /* ── Location/bien cards as full-width app rows ── */
      .app-row {
        display: flex; align-items: center; gap: 12px;
        padding: 14px 16px;
        background: white;
        border-radius: 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.07);
      }

      /* ── Modals as bottom sheets on mobile ── */
      .modal-fullscreen {
        background: rgba(0,0,0,0.45) !important;
        align-items: flex-end !important;
        padding-bottom: 0 !important;
        z-index: 10001 !important;
      }
      /* Quand un modal est ouvert, on masque la barre nav et la FAB pour que rien ne recouvre le modal */
      body:has(.modal-fullscreen.active) .mobile-bottom-nav,
      body:has(.modal-fullscreen.active) .fab-main,
      body:has(.modal.active) .mobile-bottom-nav,
      body:has(.modal.active) .fab-main {
        display: none !important;
      }
      .modal-fullscreen-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        height: 92vh !important;
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
        position: relative;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
      }
      .modal-fullscreen-content::before {
        content: '';
        display: block;
        width: 36px; height: 4px;
        background: #CBD5E1;
        border-radius: 2px;
        margin: 10px auto 6px;
        flex: 0 0 auto;
      }
      .modal-fullscreen.active .modal-fullscreen-content {
        transform: translateY(0);
      }
      .modal-fullscreen-header {
        padding: 8px 20px 12px !important;
        border-bottom: 1px solid #F1F5F9;
        flex: 0 0 auto !important;
        position: static !important;
      }
      .modal-fullscreen-header h2 {
        font-size: 17px !important;
      }
      .modal-fullscreen-body {
        padding: 16px 20px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
      }
      .modal-fullscreen-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0)) !important;
        flex: 0 0 auto !important;
        background: white;
        border-top: 1px solid #E2E8F0;
        box-shadow: 0 -4px 16px rgba(15,23,42,0.08);
      }
      .modal-fullscreen-footer .btn {
        min-height: 48px !important;
        font-size: 15px !important;
      }

      /* ── Regular modals as bottom sheets too ── */
      .modal {
        align-items: flex-end !important;
        padding-bottom: 0 !important;
      }
      .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        margin: 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: env(safe-area-inset-bottom, 8px) !important;
      }
      .modal-content::before {
        content: '';
        display: block;
        width: 36px; height: 4px;
        background: #CBD5E1;
        border-radius: 2px;
        margin: 10px auto -4px;
      }

      /* ── Buttons larger touch targets ── */
      .btn { min-height: 46px !important; font-size: 14px !important; }
      button { -webkit-tap-highlight-color: transparent; }

      /* Section titles app-like */
      .section-title-app {
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #94A3B8;
        padding: 16px 0 8px;
      }

      /* ── Quick action FAB ── */
      .fab-main {
        position: fixed;
        bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        width: 52px; height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, #1E3A5F, #16293F);
        color: white;
        border: none;
        font-size: 22px;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 4px 16px rgba(30,58,95,0.45), inset 0 -2px 0 #C9A227;
        cursor: pointer;
        z-index: 9998;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s, box-shadow 0.15s;
      }
      .fab-main:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(30, 58, 95,0.3); }

      /* Sidebar items bigger on mobile */
      .sidebar-item { padding: 14px 20px !important; font-size: 14px !important; }

      /* Search input full width */
      .search-input, input[type="search"] { width: 100% !important; }

      /* Hide desktop-only sidebar from mobile */
      .sidebar { display: none; }
      .sidebar.sidebar-open { display: flex; flex-direction: column; }

      /* Breadcrumb hidden on mobile (page title in header instead) */
      .app-topbar .breadcrumb { display: none; }

      /* Form inputs larger on mobile */
      .form-group input, .form-group select, .form-group textarea {
        font-size: 16px !important; /* prevents zoom on iOS */
        min-height: 46px !important;
        padding: 11px 14px !important;
      }

      /* ── Inputs date/time sur iOS : harmonisation visuelle complète
         (taille, padding, bordure, fond) tout en CONSERVANT le picker natif ── */
      input[type="date"],
      input[type="time"],
      input[type="datetime-local"],
      input[type="month"] {
        min-height: 46px !important;
        height: 46px !important;
        padding: 11px 14px !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
        font-family: inherit !important;
        background: white !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 8px !important;
        color: #0F172A !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        text-align: left !important;
        /* IMPORTANT : on retire l'apparence native iOS (qui ajoutait un cadre vert épais)
           sans casser le picker — sur iOS le picker s'ouvre toujours au tap */
        -webkit-appearance: none !important;
        appearance: none !important;
        /* Affiche l'icône calendrier à droite */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 12px center !important;
        padding-right: 38px !important;
      }
      /* Cacher l'icône native du calendrier sur Chrome/Safari (on a la nôtre via SVG) */
      input[type="date"]::-webkit-calendar-picker-indicator,
      input[type="time"]::-webkit-calendar-picker-indicator,
      input[type="datetime-local"]::-webkit-calendar-picker-indicator,
      input[type="month"]::-webkit-calendar-picker-indicator {
        opacity: 0;
        position: absolute;
        right: 0;
        width: 38px;
        height: 100%;
        cursor: pointer;
      }
      /* Date vide : couleur claire pour le placeholder */
      input[type="date"]:not(:focus):invalid,
      input[type="date"][value=""] {
        color: #94A3B8 !important;
      }

      /* ── PATCH dashboard "Actions rapides" : caché sur mobile ── */
      .dashboard-quick-actions {
        display: none !important;
      }

      /* ── PATCH chat IA : input + bouton Envoyer sur leur propre ligne sur mobile,
         les 3 icônes "joindre" passent au-dessus en wrap ── */
      .ia-chat-input-row {
        flex-wrap: wrap !important;
        gap: 6px !important;
      }
      .ia-chat-input-row .ia-chat-text-input {
        flex: 1 1 calc(100% - 70px) !important;
        min-width: 0 !important;
        order: 99;
      }
      .ia-chat-input-row .ia-chat-send-btn {
        flex: 0 0 auto !important;
        order: 100;
        padding: 12px 18px !important;
        min-width: 56px;
        min-height: 46px;
      }
      .ia-chat-input-row > label {
        order: 1;
        flex: 0 0 auto;
        padding: 10px 12px !important;
      }

      /* ── Anti-débordement universel : tous les flex-rows inline dans les modaux wrap automatiquement ── */
      .modal-fullscreen-body div[style*="display:flex"],
      .modal-fullscreen-body div[style*="display: flex"],
      .modal-content div[style*="display:flex"],
      .modal-content div[style*="display: flex"] {
        flex-wrap: wrap !important;
      }
      /* Tous les inputs/selects/textarea dans les modaux ne dépassent jamais leur parent */
      .modal-fullscreen-body input,
      .modal-fullscreen-body select,
      .modal-fullscreen-body textarea,
      .modal-content input,
      .modal-content select,
      .modal-content textarea {
        max-width: 100% !important;
        box-sizing: border-box !important;
      }
      /* Inputs avec flex:1 dans un flex-row : leur garantir une min-width raisonnable pour ne pas être écrasés */
      .modal-fullscreen-body input[style*="flex:1"],
      .modal-fullscreen-body input[style*="flex: 1"],
      .modal-content input[style*="flex:1"],
      .modal-content input[style*="flex: 1"] {
        min-width: 100px !important;
      }

      /* ── Barre d'actions de page (Biens / Locataires) : recherche pleine largeur sur mobile ── */
      .page-actions-bar {
        gap: 8px !important;
      }
      .page-actions-bar .page-search-input {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        order: 99;
        margin-left: 0 !important;
      }
      .page-actions-bar-right {
        margin-left: 0 !important;
        order: 50;
      }

      /* ── Suivi mensuel rows : wrap proprement sur mobile ── */
      .suivi-row {
        flex-wrap: wrap !important;
        row-gap: 4px !important;
        padding: 8px 10px !important;
      }
      .suivi-row .suivi-row-name {
        flex: 1 1 100%;
        order: 2;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
      }
      .suivi-row .suivi-row-bien {
        flex: 1 1 100%;
        order: 3;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
      }
      .suivi-row .suivi-row-amount {
        order: 4;
        margin-left: auto !important;
      }
      .suivi-row .suivi-row-status,
      .suivi-row .suivi-row-date {
        order: 5;
      }
      .suivi-row .suivi-row-actions {
        order: 6;
      }
      .suivi-row .suivi-row-actions button {
        min-width: 32px;
        min-height: 32px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
      }
    }

    /* ── Paywall / Subscription screen ── */
    .paywall-overlay {
      position: fixed; inset: 0;
      background: linear-gradient(160deg, #0F172A 0%, #1E293B 60%, #0A141F 100%);
      z-index: 50000;
      display: flex; flex-direction: column;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .paywall-header {
      text-align: center;
      padding: 48px 24px 24px;
      color: white;
    }
    .paywall-header .paywall-logo { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
    .paywall-header .paywall-logo span { color: #C9A227; }
    .paywall-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; line-height: 1.25; }
    .paywall-header p { font-size: 15px; color: #94A3B8; }
    .paywall-plans { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; max-width: 480px; margin: 0 auto; width: 100%; }
    .paywall-plan {
      background: rgba(255,255,255,0.07);
      border: 1.5px solid rgba(255,255,255,0.12);
      border-radius: 16px;
      padding: 20px;
      color: white;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
    }
    .paywall-plan:active { transform: scale(0.98); }
    .paywall-plan.featured {
      background: linear-gradient(135deg, rgba(30, 58, 95,0.25), rgba(59,130,246,0.2));
      border-color: #1E3A5F;
      box-shadow: 0 0 0 1px #1E3A5F, 0 8px 32px rgba(30, 58, 95,0.2);
    }
    .paywall-plan-badge {
      position: absolute; top: -10px; right: 16px;
      background: linear-gradient(135deg, #1E3A5F, #3B82F6);
      color: white; font-size: 11px; font-weight: 700;
      padding: 3px 12px; border-radius: 999px;
      text-transform: uppercase; letter-spacing: 0.05em;
    }
    .paywall-plan-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
    .paywall-plan-name { font-size: 18px; font-weight: 700; }
    .paywall-plan-price { text-align: right; }
    .paywall-plan-amount { font-size: 24px; font-weight: 800; color: #1E3A5F; }
    .paywall-plan-period { font-size: 12px; color: #94A3B8; }
    .paywall-plan-features { list-style: none; padding: 0; margin: 0 0 16px; }
    .paywall-plan-features li { font-size: 13px; color: #CBD5E1; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
    .paywall-plan-features li i { color: #10B981; font-size: 12px; flex-shrink: 0; }
    .paywall-plan-features li.locked { color: #475569; }
    .paywall-plan-features li.locked i { color: #475569; }
    .paywall-btn {
      width: 100%; padding: 13px;
      border-radius: 12px; border: none;
      font-size: 15px; font-weight: 700;
      cursor: pointer; transition: all 0.15s;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .paywall-btn-primary { background: linear-gradient(135deg,#1E3A5F,#3B82F6); color: white; box-shadow: 0 4px 14px rgba(30, 58, 95,0.35); }
    .paywall-btn-primary:active { transform: scale(0.97); }
    .paywall-btn-ghost { background: rgba(255,255,255,0.08); color: #94A3B8; border: 1px solid rgba(255,255,255,0.12); }
    .paywall-footer { text-align: center; padding: 8px 20px 48px; color: #475569; font-size: 12px; }
    .paywall-footer a { color: #1E3A5F; text-decoration: none; }

    /* ============================================================
       MOBILE UX polish (feature/mobile-ux) — ≤768 / ≤480
       Anti-overflow, tap targets, sheets, safe-area, cookie banner
       ============================================================ */
    html { -webkit-text-size-adjust: 100%; }
    @media (max-width: 768px) {
      html, body { overflow-x: hidden; max-width: 100vw; }
      body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

      /* Chips / filtres : cibles ≥ 44px */
      .ux-chip { min-height: 44px !important; padding: 10px 14px !important; font-size: 13px !important; }

      /* Inputs partout ≥ 16px (évite zoom iOS), y compris styles inline */
      input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
      select, textarea {
        font-size: 16px !important;
        max-width: 100%;
        box-sizing: border-box;
      }

      /* Grilles minmax larges → 1 colonne fluide */
      #content [style*="minmax(300px"],
      #content [style*="minmax(320px"],
      #content [style*="minmax(400px"] {
        grid-template-columns: 1fr !important;
      }

      /* Barre d'actions page : primaire pleine largeur, export/import en 2e ligne */
      .page-actions-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
      }
      .page-actions-bar > .btn-primary {
        flex: 1 1 100% !important;
        width: 100% !important;
        justify-content: center;
      }
      .page-actions-bar-right {
        flex: 1 1 100% !important;
        display: flex !important;
        gap: 8px !important;
        margin-left: 0 !important;
      }
      .page-actions-bar-right .btn,
      .page-actions-bar-right label.btn {
        flex: 1 1 0 !important;
        justify-content: center;
        text-align: center;
        min-height: 44px !important;
      }

      /* Cartes location : actions en grille 2 colonnes */
      .loc-card-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
      }
      .loc-card-actions > button,
      .loc-card-actions > label {
        width: 100% !important;
        min-height: 44px !important;
        flex: none !important;
      }

      /* Breadcrumbs page : masquer (titre déjà dans le header) */
      .page-breadcrumb { display: none !important; }

      /* Cookie banner compacte au-dessus de la bottom nav */
      #cookieBanner {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 10px !important;
        align-items: stretch !important;
        flex-direction: column !important;
        z-index: 10000 !important; /* sous modals (10001+), au-dessus bottom nav */
      }
      #cookieBanner > div:first-child {
        min-width: 0 !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
      }
      #cookieBanner > div:last-child {
        display: flex !important;
        gap: 8px !important;
        width: 100%;
      }
      #cookieBanner button {
        flex: 1 !important;
        min-height: 44px !important;
        font-size: 14px !important;
      }
      /* Si pas connecté / pas de bottom nav, coller au bas */
      body:not(:has(.mobile-bottom-nav)) #cookieBanner,
      body:not(:has(#mobileBottomNav)) #cookieBanner {
        bottom: 0 !important;
      }

      /* Tables : scroll horizontal contenu, jamais la page */
      .table-container,
      .tbl-scroll,
      [class*="table-wrap"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
      }
      table { max-width: 100%; }

      /* Footer modal sticky déjà géré — boutons pleine largeur empilés si étroits */
      .modal-fullscreen-footer {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
      }
      .modal-fullscreen-footer .btn,
      .modal-fullscreen-footer .btn-secondary-cf,
      .modal-fullscreen-footer button {
        min-height: 48px !important;
        flex: 1 1 calc(50% - 8px) !important;
      }

      /* Titres fiche bien / headers trop larges */
      #content h1 { font-size: 22px !important; word-break: break-word; }

      /* Safe-area sidebar drawer */
      .sidebar.sidebar-open {
        padding-top: env(safe-area-inset-top, 0px) !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
      }
    }

    @media (max-width: 480px) {
      .loc-card-actions { grid-template-columns: 1fr 1fr !important; }
      .stat-card, .grid-4 > * { min-width: 0 !important; }
      #content { padding: 10px 12px 8px !important; }
      /* Login bottom sheet : corps scrollable, inputs 16px */
      #loginModal .modal-content {
        max-height: 90vh !important;
        display: flex;
        flex-direction: column;
      }
      #loginModal input {
        font-size: 16px !important;
        min-height: 46px !important;
      }
    }

    /* ── Indicateur de synchronisation (navy / or) ── */
    .mi-sync-pill { display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px; border-radius:999px; border:1px solid rgba(201,162,39,0.55); background:#1E3A5F; color:#F8FAFC; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:inherit; line-height:1; }
    .mi-sync-pill i { color:#C9A227; font-size:13px; }
    .mi-sync-pill .mi-sync-time { color:#E9D58A; font-weight:500; padding-left:6px; border-left:1px solid rgba(201,162,39,0.45); }
    .mi-sync-pill:hover { background:#24476F; }
    .mi-sync-pill:focus-visible, .mi-sync-mobile:focus-visible { outline:2px solid #C9A227; outline-offset:2px; }
    .mi-sync-pill[data-state="offline"] { background:#334155; border-color:#64748B; }
    .mi-sync-pill[data-state="offline"] i { color:#CBD5E1; }
    .mi-sync-pill[data-state="error"] { background:#7F1D1D; border-color:#FCA5A5; }
    .mi-sync-pill[data-state="error"] i { color:#FCA5A5; }
    .mi-sync-mobile { position:relative; width:40px !important; min-width:40px !important; height:44px !important; min-height:44px !important; font-size:16px !important; padding:0 !important; }
    .mi-sync-mobile i { color:#C9A227; }
    .mi-sync-mobile .mi-sync-dot { position:absolute; top:9px; right:6px; width:8px; height:8px; border-radius:50%; background:#C9A227; border:1.5px solid #0F172A; }
    .mi-sync-mobile[data-state="offline"] i { color:#94A3B8; }
    .mi-sync-mobile[data-state="offline"] .mi-sync-dot { background:#94A3B8; }
    .mi-sync-mobile[data-state="error"] i { color:#F87171; }
    .mi-sync-mobile[data-state="error"] .mi-sync-dot { background:#EF4444; }
    .mi-sync-mobile[data-state="synced"] .mi-sync-dot { display:none; }
    @media (max-width: 1100px) { .mi-sync-pill .mi-sync-time { display:none; } }
    .mi-sync-loading { padding:48px 16px; text-align:center; color:#1E3A5F; font-weight:600; }
    .mi-sync-loading i { color:#C9A227; margin-right:8px; }
    .mi-sync-panel { font-size:14px; color:#1E293B; }
    .mi-sync-panel-status { display:flex; align-items:center; gap:8px; padding:12px 14px; border-radius:10px; background:#1E3A5F; color:#F8FAFC; margin-bottom:12px; }
    .mi-sync-panel-status i { color:#C9A227; }
    .mi-sync-panel-status[data-state="error"] { background:#7F1D1D; }
    .mi-sync-panel-status[data-state="offline"] { background:#334155; }
    .mi-sync-panel-row { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid #F1F5F9; flex-wrap:wrap; }
    .mi-sync-panel-row span { color:#64748B; }
    .mi-sync-panel-note { font-size:12px; color:#64748B; margin:12px 0; }
    .mi-sync-quarantine { background:#FFFBEB; border:1px solid #FDE68A; border-radius:10px; padding:12px; margin:12px 0; font-size:13px; }
    .mi-sync-quarantine ul, .mi-sync-log ul { margin:8px 0 0; padding-left:18px; max-height:180px; overflow-y:auto; word-break:break-word; }
    .mi-sync-log { margin:12px 0; font-size:12px; color:#334155; }
    .mi-sync-log li span { color:#94A3B8; }
    .mi-sync-btn, .mi-sync-btn-secondary { width:100%; min-height:44px; border-radius:10px; font-weight:700; cursor:pointer; font-size:14px; margin-top:8px; }
    .mi-sync-btn { background:#1E3A5F; color:#F8FAFC; border:1px solid #C9A227; }
    .mi-sync-btn i { color:#C9A227; margin-right:6px; }
    .mi-sync-btn-secondary { background:#FFFFFF; color:#1E3A5F; border:1px solid #C9A227; }
    /* ── Clés : remise lue depuis la location active ── */
    .mi-remise-cles { border:1px solid #FDE68A; background:#FFFBEB; border-radius:10px; padding:12px 14px; margin-bottom:14px; color:#1E3A5F; font-size:13px; }
    .mi-remise-cles-title { font-weight:700; margin-bottom:8px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
    .mi-remise-cles-title i { color:#C9A227; }
    .mi-remise-cles-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px; }
    .mi-remise-cles-grid div { background:#FFFFFF; border:1px solid #FDE68A; border-radius:8px; padding:8px 10px; }
    .mi-remise-cles-grid span { display:block; font-size:11px; color:#64748B; }
    .mi-remise-cles-grid strong { font-size:15px; }
    .mi-remise-cles-link { margin-top:10px; min-height:44px; padding:8px 14px; border-radius:8px; border:1px solid #C9A227; background:#1E3A5F; color:#F8FAFC; font-weight:600; cursor:pointer; font-size:13px; }
    .mi-remise-cles-note { font-size:11px; color:#64748B; margin-top:6px; }

