
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Nunito', sans-serif; background: #f0f6ff; min-height: 100vh; }

  .header {
    position: relative;
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
    color: white;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
  }
  .header-badge {
    display: inline-block;
    background: #f97316;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .header-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
  }
  .header-logo { display: flex; align-items: center; gap: 14px; }
  .header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  .header-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-user {
    font-size: 11px;
    color: rgba(255,255,255,0.72);
    max-width: 320px;
    text-align: right;
    line-height: 1.2;
    word-break: break-word;
  }

  .main { max-width: 900px; margin: 0 auto; padding: 40px 24px; }

  .top-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
  }
  .top-bar h2 { font-size: 20px; font-weight: 800; color: #0f172a; }

  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 10px; border: none;
    font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
  }
  .btn-primary { background: linear-gradient(135deg, #0369a1, #0ea5e9); color: white; box-shadow: 0 4px 14px rgba(14,165,233,0.35); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14,165,233,0.45); }
  .btn-new-project { background: linear-gradient(135deg, #ea580c, #f97316) !important; box-shadow: 0 4px 14px rgba(249,115,22,0.35) !important; }
  .btn-danger { background: #fee2e2; color: #b91c1c; }
  .btn-danger:hover { background: #fecaca; }
  .btn-chiffrage { background: #f97316; color: white; border: none; }
  .btn-chiffrage:hover { background: #ea580c; }
  .btn-duplicate { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; padding: 10px 13px; }
  .btn-duplicate:hover { background: #e0e7ff; }
  .btn-devis { background: linear-gradient(135deg, #0d9488, #14b8a6); color: white; box-shadow: 0 4px 14px rgba(20,184,166,0.3); }
  .btn-devis:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,184,166,0.4); }
  .btn-ghost { background: #f1f5f9; color: #475569; }
  .btn-ghost:hover { background: #e2e8f0; }

  .search-bar {
    width: 100%; padding: 11px 16px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-family: 'Nunito', sans-serif; font-size: 14px;
    background: white; outline: none; transition: border-color 0.2s;
    margin-bottom: 20px;
  }
  .search-bar:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
  .search-wrap { position: relative; }


  .projects-grid { display: flex; flex-direction: column; gap: 12px; }

  .project-card {
    background: white; border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    padding: 20px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .project-card:hover { border-color: #0ea5e9; box-shadow: 0 6px 24px rgba(14,165,233,0.12); transform: translateY(-1px); }

  .project-info { flex: 1; min-width: 0; }
  .project-name { font-size: 17px; font-weight: 800; color: #0f172a; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .project-meta { font-size: 12px; color: #94a3b8; display: flex; gap: 16px; flex-wrap: wrap; }
  .project-meta span { display: flex; align-items: center; gap: 4px; }

  .project-actions { display: flex; gap: 8px; flex-shrink: 0; }

  .badge-new {
    background: #dcfce7; color: #15803d;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
  }

  .empty-state {
    text-align: center; padding: 60px 20px;
    color: #94a3b8;
  }
  .empty-state .icon { font-size: 48px; margin-bottom: 16px; }
  .empty-state h3 { font-size: 18px; font-weight: 700; color: #475569; margin-bottom: 8px; }
  .empty-state p { font-size: 14px; }

  /* Modal */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal {
    background: white; border-radius: 16px; padding: 32px;
    width: 100%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: translateY(20px); transition: transform 0.2s;
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal h3 { font-size: 18px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
  .modal p { font-size: 13px; color: #64748b; margin-bottom: 20px; }
  .modal input {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-family: 'Nunito', sans-serif; font-size: 15px;
    outline: none; transition: border-color 0.2s; margin-bottom: 16px;
  }
  .modal input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

  .loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
  .error-msg { background: #fee2e2; color: #b91c1c; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }

  .stats-bar {
    display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
  }
  .stat-card {
    background: white; border-radius: 10px; padding: 14px 20px;
    border: 1.5px solid #e2e8f0; flex: 1; min-width: 120px;
    text-align: center;
  }
  .stat-card .num { font-size: 24px; font-weight: 800; color: #0369a1; }
  .stat-card .lbl { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 2px; }

  /* ── TABLET RESPONSIVE (768px – 1024px) ── */
  @media (max-width: 1024px) and (min-width: 768px) {
    .header { padding: 0.9rem 1rem; }
    .header-center { display: none; }
    .header-actions-row { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
    .header-actions-row a, .header-actions-row button { font-size: 11px; padding: 5px 10px; }
    .header-actions-row .btn { padding: 8px 14px; font-size: 13px; }

    .main { padding: 24px 14px; }

    .project-card { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
    .project-actions { flex-wrap: wrap; gap: 6px; }
    .project-actions .btn { padding: 8px 12px; font-size: 13px; }
    .btn-duplicate { padding: 8px 10px; }

    .project-name { font-size: 15px; }
  }
