
/* ===== Unified premium styles: index / chantier / project / task ===== */

/* Buttons & generic fields */
.dashboard-btn-primary,
.chantier-btn-primary,
.project-btn-primary,
.task-btn-primary{
  background: linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
  border:none;
  border-radius:16px;
  padding:.92rem 1.2rem;
  font-weight:700;
  box-shadow:0 10px 20px rgba(37,99,235,.22);
}
.dashboard-btn-primary:hover,
.chantier-btn-primary:hover,
.project-btn-primary:hover,
.task-btn-primary:hover{ color:#fff; filter:brightness(1.03); }

.dashboard-btn-success,
.chantier-btn-success{
  background: linear-gradient(135deg,#16a34a,#15803d);
  color:#fff;
  border:none;
  border-radius:16px;
  padding:.92rem 1.2rem;
  font-weight:700;
}
.dashboard-btn-success:hover,
.chantier-btn-success:hover{ color:#fff; filter:brightness(1.03); }

.dashboard-btn-soft,
.chantier-btn-soft,
.project-btn-soft,
.task-btn-soft{
  background:#eef4ff;
  color:#1d4ed8;
  border:1px solid #cfe0ff;
  border-radius:16px;
  padding:.85rem 1rem;
  font-weight:700;
}
.dashboard-btn-soft:hover,
.chantier-btn-soft:hover,
.project-btn-soft:hover,
.task-btn-soft:hover{ color:#1d4ed8; background:#e6f0ff; }

.project-btn-outline{
  background:#fff;
  color:#334155;
  border:1px solid #d8e1ec;
  border-radius:16px;
  padding:.78rem 1rem;
  font-weight:700;
}
.project-btn-outline:hover{ color:#0f172a; background:#f8fafc; }

.dashboard-btn-danger{
  background:#fff1f2;
  color:#be123c;
  border:1px solid #fecdd3;
  border-radius:16px;
  padding:.85rem 1rem;
  font-weight:700;
}
.dashboard-btn-danger:hover{ color:#9f1239; background:#ffe4e6; }

.dashboard-input,
.chantier-input,
.project-input,
.task-input{
  border-radius:18px !important;
  border:1px solid #d9e2f1 !important;
  background: linear-gradient(180deg,#ffffff,#f8fbff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  padding:.95rem 1rem !important;
}
.dashboard-input:focus,
.chantier-input:focus,
.project-input:focus,
.task-input:focus{
  border-color:#60a5fa !important;
  box-shadow:0 0 0 .25rem rgba(59,130,246,.14) !important;
}

/* ===== Dashboard hero ===== */
.dashboard-hero{
  background: linear-gradient(135deg,#0f172a 0%, #1d4ed8 55%, #38bdf8 100%);
  border-radius: 30px;
  padding: 34px;
  color: #fff;
  box-shadow: 0 22px 50px rgba(15,23,42,.22);
}
.dashboard-hero-kicker{
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .84rem;
  font-weight: 700;
  color: rgba(255,255,255,.72);
  margin-bottom: .65rem;
}
.dashboard-hero-title{
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.02;
  font-weight: 800;
  margin: 0 0 .8rem 0;
}
.dashboard-hero-subtitle{
  max-width: 720px;
  font-size: 1.05rem;
  color: rgba(255,255,255,.88);
  margin-bottom: 1rem;
}
.dashboard-hero-chips{ display:flex; flex-wrap:wrap; gap:.7rem; }
.dashboard-chip{
  padding:.6rem .95rem; border-radius:999px; font-weight:700; font-size:.92rem;
}
.dashboard-chip-light{
  background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.16); color:#fff; backdrop-filter: blur(6px);
}
.dashboard-hero-actions{ display:flex; flex-direction:column; gap:.9rem; justify-content:center; height:100%; }
.dashboard-stats-grid{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
.dashboard-stat-card{
  background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.14);
  border-radius: 24px; padding: 1.1rem; backdrop-filter: blur(6px);
}
.dashboard-stat-card-highlight{ background: linear-gradient(135deg, rgba(250,204,21,.20), rgba(255,255,255,.10)); }
.dashboard-stat-icon{ font-size: 1.25rem; margin-bottom: .45rem; }
.dashboard-stat-label{
  font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.72); margin-bottom: .25rem;
}
.dashboard-stat-value{ font-size: 1.9rem; font-weight: 800; line-height: 1.05; }
.dashboard-stat-value-money{ font-size: 1.45rem; }
.dashboard-premium-card,
.dashboard-chantier-card,
.chantier-card-premium,
.chantier-project-card,
.project-premium-card,
.task-card-premium{
  border-radius: 26px; overflow:hidden; background: linear-gradient(180deg,#ffffff,#fbfdff);
}
.dashboard-section-icon,
.chantier-icon-box,
.project-section-icon,
.task-section-icon{
  width:50px; height:50px; border-radius:16px; display:flex; align-items:center; justify-content:center;
  font-size:1.35rem; background: linear-gradient(135deg,#dbeafe,#bfdbfe);
}
.dashboard-section-icon-yellow,
.chantier-icon-box-yellow{ background: linear-gradient(135deg,#fef3c7,#fde68a); }
.dashboard-mini-stats{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.8rem; }
.dashboard-mini-stat,
.chantier-project-metric{
  background:#f8fbff; border:1px solid #e4eefb; border-radius:18px; padding:.9rem;
}
.dashboard-mini-stat span,
.chantier-project-metric span{ display:block; font-size:.8rem; color:#64748b; margin-bottom:.2rem; }
.dashboard-mini-stat strong,
.chantier-project-metric strong{ display:block; color:#0f172a; font-size:1rem; }

/* ===== Chantier hero ===== */
.chantier-hero{
  background: linear-gradient(135deg,#0f172a 0%,#1d4ed8 58%,#38bdf8 100%);
  color:#fff; border-radius: 28px; padding: 28px 30px; box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
}
.chantier-hero-kicker{
  font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; opacity:.72; font-weight:700; margin-bottom:.35rem;
}
.chantier-hero-back,
.project-hero-back,
.task-hero-back{
  display:inline-flex; align-items:center; gap:.45rem; color:rgba(255,255,255,.88); text-decoration:none;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16); border-radius:999px; padding:.45rem .85rem; margin-bottom:1rem;
}
.chantier-hero-back:hover,
.project-hero-back:hover,
.task-hero-back:hover{ color:#fff; background:rgba(255,255,255,.16); }
.chantier-hero-title{
  font-size: clamp(2rem, 4.3vw, 3.3rem); line-height:1.03; font-weight:800; margin:0 0 .45rem 0;
}
.chantier-hero-subtitle{ opacity:.82; }
.chantier-hero-badges{ display:flex; flex-wrap:wrap; gap:.55rem; margin-top:1rem; }
.chantier-hero-stats{
  display:grid; grid-template-columns: repeat(6, minmax(110px,1fr)); gap:.9rem;
}
.chantier-stat{
  background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.14); border-radius:20px; padding:1rem; backdrop-filter: blur(6px);
}
.chantier-stat-label{
  font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; color:rgba(255,255,255,.72); margin-bottom:.3rem;
}
.chantier-stat-value{ font-size:1.1rem; font-weight:800; }
.chantier-members-list{ display:flex; flex-direction:column; gap:.9rem; }
.chantier-member-card{
  display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem; border-radius:18px; background:#f8fbff; border:1px solid #e4eefb;
}
.chantier-project-metrics{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:.8rem; }
.chantier-progress-shell,
.project-progress-shell{
  height:11px; border-radius:999px; background:#e2e8f0; overflow:hidden;
}
.chantier-progress-fill,
.project-progress-fill{ background: linear-gradient(90deg,#22c55e,#eab308); }

/* ===== Project hero ===== */
.project-hero{
  background: linear-gradient(135deg,#111827 0%,#1d4ed8 52%,#22d3ee 100%);
  color:#fff; border-radius:28px; padding:28px 30px; box-shadow:0 18px 45px rgba(15,23,42,.22);
}
.project-hero-kicker{
  font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; opacity:.72; font-weight:700; margin-bottom:.35rem;
}
.project-hero-title{
  font-size: clamp(2rem, 4.3vw, 3.2rem); line-height:1.03; font-weight:800; margin:0 0 .45rem 0;
}
.project-hero-subtitle{ opacity:.84; font-size:1rem; }
.project-hero-side{
  min-width: 250px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.16);
  border-radius:22px; padding:1rem 1.1rem; backdrop-filter: blur(6px);
}
.project-hero-budget-label{
  text-transform:uppercase; letter-spacing:.04em; font-size:.8rem; color:rgba(255,255,255,.72); margin-bottom:.25rem;
}
.project-hero-budget-value{ font-size:1.6rem; font-weight:800; }
.project-hero-side-note{ color:rgba(255,255,255,.78); margin-top:.2rem; }
.project-chip-row{ display:flex; flex-wrap:wrap; gap:.65rem; }
.project-chip{
  display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; padding:.62rem .95rem; border-radius:999px;
  background:rgba(255,255,255,.10); color:#fff; border:1px solid rgba(255,255,255,.16); font-weight:700;
}
.project-chip:hover{ color:#fff; background:rgba(255,255,255,.16); }
.project-chip-active{ background:#fff; color:#0f172a; border-color:#fff; }
.project-chip-soft{ background:rgba(255,255,255,.14); }
.project-stats-grid{ display:grid; grid-template-columns: repeat(6, minmax(110px,1fr)); gap:.9rem; }
.project-stat-card{
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.14); border-radius:20px; padding:1rem; backdrop-filter: blur(6px);
}
.project-stat-label{
  text-transform:uppercase; letter-spacing:.04em; font-size:.78rem; color:rgba(255,255,255,.72); margin-bottom:.3rem;
}
.project-stat-value{ font-size:1.2rem; font-weight:800; }
.project-stat-sub{ font-size:.82rem; color:rgba(255,255,255,.74); margin-top:.2rem; }
.project-helper{
  display:flex; align-items:center; gap:1rem; padding:1rem 1.1rem; border-radius:22px; background:linear-gradient(180deg,#ffffff,#f8fbff);
  border:1px solid #e4eefb; box-shadow:0 10px 28px rgba(15,23,42,.06);
}
.project-helper-icon{
  width:48px; height:48px; border-radius:16px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#dbeafe,#bfdbfe); color:#1d4ed8; font-weight:800; font-size:1.25rem;
}
.project-premium-card .form-label,
.chantier-card-premium .form-label,
.dashboard-premium-card .form-label{ font-weight:700; color:#0f172a; }
.project-kanban-column{
  border-radius:24px; overflow:hidden; background:linear-gradient(180deg,#ffffff,#fbfdff);
}
.project-kanban-header{
  padding:1rem 1.1rem; font-weight:800; color:#fff; letter-spacing:.02em;
}
.project-kanban-todo{ background:linear-gradient(135deg,#2563eb,#1d4ed8); }
.project-kanban-waiting{ background:linear-gradient(135deg,#f59e0b,#d97706); }
.project-kanban-done{ background:linear-gradient(135deg,#16a34a,#15803d); }
.project-kanban-slot{ padding:1rem; border-top:1px solid #eef2f7; }
.project-slot-title{
  font-size:.82rem; text-transform:uppercase; letter-spacing:.04em; color:#64748b; margin-bottom:.75rem; font-weight:700;
}
.task-drag-handle{
  cursor: move; background: linear-gradient(90deg,#eff6ff,#dbeafe); color:#1d4ed8; border-bottom:1px solid #dbeafe;
  padding:.55rem .8rem; font-weight:700; user-select:none;
}
.project-task-card{
  border:none; border-radius:18px; overflow:hidden; box-shadow:0 10px 20px rgba(15,23,42,.06);
}
.sortable-ghost{ opacity:.35; }
.sortable-fallback{ opacity:.9 !important; transform: rotate(1deg); }
.drag-active .task-drag-handle{ cursor: grabbing; }

/* ===== Task page ===== */
.task-hero{
  background: linear-gradient(135deg,#111827 0%,#1d4ed8 55%,#0ea5e9 100%);
  border-radius: 28px; padding: 28px 30px; color: #fff; box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
}
.task-hero-kicker{
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: .35rem; font-weight: 700;
}
.task-hero-title{
  font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 800; line-height: 1.02; margin: 0 0 .45rem 0;
}
.task-hero-subtitle{ opacity:.8; font-size:1rem; }
.task-hero-badges{ display:flex; flex-wrap:wrap; gap:.55rem; margin-top:1rem; }
.task-hero-metrics{ display:grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: .9rem; min-width: min(420px, 100%); }
.task-hero-metric{
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 1rem; backdrop-filter: blur(6px);
}
.task-hero-metric-label{ font-size:.8rem; text-transform: uppercase; letter-spacing:.04em; color: rgba(255,255,255,.72); margin-bottom:.35rem; }
.task-hero-metric-value{ font-size:1.35rem; font-weight:800; }
.task-progress-bar-shell{ height: 12px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; }
.task-progress-bar-fill{ background: linear-gradient(90deg,#22c55e,#facc15); }
.task-section-icon-edit{ background: linear-gradient(135deg,#dbeafe,#bfdbfe); }
.task-section-icon-photo{ background: linear-gradient(135deg,#fef3c7,#fde68a); }
.task-form-grid{ display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.task-form-block-full{ grid-column: 1 / -1; }
.task-cost-compare{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.9rem; }
.task-cost-pill{
  border-radius:18px; padding:1rem; background: linear-gradient(180deg,#eff6ff,#ffffff); border:1px solid #dbeafe;
}
.task-cost-pill span{ display:block; font-size:.82rem; color:#475569; margin-bottom:.3rem; }
.task-cost-pill strong{ font-size:1.1rem; color:#0f172a; }
.task-cost-pill-danger{ background: linear-gradient(180deg,#fff1f2,#ffffff); border-color:#fecdd3; }
.task-cost-pill-success{ background: linear-gradient(180deg,#ecfdf5,#ffffff); border-color:#bbf7d0; }
.task-cost-pill-secondary{ background: linear-gradient(180deg,#f8fafc,#ffffff); border-color:#e2e8f0; }
.task-btn-photo{
  background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; border:none; border-radius:16px; padding:.95rem 1.2rem; font-weight:700;
}
.task-btn-photo:hover{ color:#fff; filter: brightness(1.03); }
.task-side-list{ display:flex; flex-direction:column; gap:.9rem; }
.task-side-item{
  display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.9rem 1rem; border-radius:16px; background:#f8fbff; border:1px solid #e4eefb;
}
.task-side-item span{ color:#475569; }
.task-side-item strong{ color:#0f172a; }
.task-photo-thumb img{ width:100%; aspect-ratio:1/1; object-fit:cover; box-shadow: 0 8px 18px rgba(15,23,42,.12); }
.task-empty-photos{
  border: 2px dashed #cbd5e1; border-radius: 24px; padding: 1.2rem; text-align:center; color:#64748b; background:#f8fafc;
}

/* ===== Responsive ===== */
@media (max-width: 1199px){
  .dashboard-stats-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chantier-hero-stats,
  .project-stats-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .task-hero-metrics{ grid-template-columns: repeat(3, 1fr); width:100%; min-width:100%; }
}
@media (max-width: 767px){
  .dashboard-hero,
  .chantier-hero,
  .project-hero,
  .task-hero{ padding:24px 18px; border-radius:24px; }
  .dashboard-stats-grid,
  .dashboard-mini-stats,
  .chantier-hero-stats,
  .project-stats-grid,
  .chantier-project-metrics,
  .task-hero-metrics,
  .task-form-grid,
  .task-cost-compare{ grid-template-columns: 1fr; }
  .dashboard-hero-actions{ margin-top:.5rem; }
  .chantier-member-card{ flex-direction:column; align-items:flex-start; }
}



/* ===== Users page ===== */
.users-hero{
  background: linear-gradient(135deg,#0f172a 0%,#7c3aed 45%,#2563eb 100%);
  color:#fff;
  border-radius:28px;
  padding:30px;
  box-shadow:0 18px 45px rgba(15,23,42,.22);
}
.users-hero-kicker{
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  opacity:.75;
  font-weight:700;
  margin-bottom:.4rem;
}
.users-hero-title{
  font-size:clamp(2rem,4vw,3.4rem);
  line-height:1.02;
  font-weight:800;
  margin:0 0 .6rem 0;
}
.users-hero-subtitle{
  color:rgba(255,255,255,.88);
  max-width:720px;
  margin-bottom:1rem;
}
.users-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
}
.users-chip{
  padding:.55rem .95rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.10);
  font-weight:700;
}
.users-hero-actions{
  display:flex;
  flex-direction:column;
  gap:.85rem;
}
.users-note-card{
  border-radius:18px;
  padding:1rem;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.16);
  color:rgba(255,255,255,.92);
}
.users-stats-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.9rem;
}
.users-stat-card{
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.14);
  border-radius:20px;
  padding:1rem;
}
.users-stat-label{
  font-size:.8rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:rgba(255,255,255,.72);
  margin-bottom:.3rem;
}
.users-stat-value{
  font-size:1.55rem;
  font-weight:800;
}

.users-card{
  border-radius:24px;
  overflow:hidden;
  background:linear-gradient(180deg,#ffffff,#fbfdff);
}
.users-icon-box{
  width:48px;
  height:48px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.25rem;
  background:linear-gradient(135deg,#dbeafe,#bfdbfe);
}
.users-list{
  display:flex;
  flex-direction:column;
  gap:.85rem;
}
.users-list-item{
  display:flex;
  align-items:center;
  gap:1rem;
  text-decoration:none;
  color:inherit;
  border-radius:18px;
  padding:1rem;
  border:1px solid #e5edf8;
  background:#f8fbff;
}
.users-list-item:hover{
  background:#f1f7ff;
  color:inherit;
}
.users-list-item-active{
  border-color:#93c5fd;
  background:linear-gradient(180deg,#eff6ff,#f8fbff);
  box-shadow:0 10px 22px rgba(37,99,235,.10);
}
.users-avatar{
  width:54px;
  height:54px;
  border-radius:50%;
  overflow:hidden;
  background:linear-gradient(135deg,#1d4ed8,#7c3aed);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  flex:0 0 auto;
}
.users-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.users-avatar-lg{
  width:76px;
  height:76px;
}
.users-list-main{
  min-width:0;
  flex:1;
}
.users-list-name{
  font-weight:800;
  color:#0f172a;
}
.users-list-login{
  color:#64748b;
  font-size:.92rem;
}
.users-mini-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin-top:.45rem;
}
.users-mini-metrics span{
  font-size:.78rem;
  color:#475569;
  background:#fff;
  border:1px solid #dbe7f5;
  padding:.32rem .55rem;
  border-radius:999px;
}
.users-list-badges{
  display:flex;
  flex-direction:column;
  gap:.4rem;
  align-items:flex-end;
}

.users-profile-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}
.users-profile-pill{
  padding:.45rem .8rem;
  border-radius:999px;
  background:#eef4ff;
  color:#1d4ed8;
  border:1px solid #cfe0ff;
  font-weight:700;
}
.users-panel{
  border-radius:22px;
  padding:1.2rem;
  background:#f8fbff;
  border:1px solid #e4eefb;
}
.users-mini-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.1rem;
  background:linear-gradient(135deg,#dbeafe,#bfdbfe);
}
.users-mini-icon-yellow{
  background:linear-gradient(135deg,#fef3c7,#fde68a);
}
.users-input{
  border-radius:18px !important;
  border:1px solid #d9e2f1 !important;
  background:linear-gradient(180deg,#ffffff,#f8fbff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  padding:.9rem 1rem !important;
}
.users-input:focus{
  border-color:#60a5fa !important;
  box-shadow:0 0 0 .25rem rgba(59,130,246,.14) !important;
}
.users-check-card{
  display:flex;
  align-items:center;
  gap:.75rem;
  height:100%;
  border-radius:18px;
  border:1px solid #dce8f7;
  background:#fff;
  padding:1rem;
  cursor:pointer;
}
.users-check-card:hover{
  background:#f8fbff;
}
.users-btn-primary{
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
  border:none;
  border-radius:16px;
  padding:.9rem 1.2rem;
  font-weight:700;
  box-shadow:0 10px 20px rgba(37,99,235,.22);
}
.users-btn-primary:hover{ color:#fff; filter:brightness(1.03); }
.users-btn-soft{
  background:#eef4ff;
  color:#1d4ed8;
  border:1px solid #cfe0ff;
  border-radius:16px;
  padding:.9rem 1.2rem;
  font-weight:700;
}
.users-btn-soft:hover{ color:#1d4ed8; background:#e6f0ff; }

@media (max-width:1199px){
  .users-stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:767px){
  .users-hero{
    padding:22px 18px;
    border-radius:22px;
  }
  .users-stats-grid{
    grid-template-columns:1fr;
  }
  .users-list-item{
    align-items:flex-start;
  }
  .users-list-badges{
    align-items:flex-start;
  }
}


/* ===== V2.1 budget réel ===== */
.dashboard-stats-grid-v21{
  grid-template-columns: repeat(6, minmax(0,1fr));
}
.dashboard-mini-stats-v21{
  grid-template-columns: repeat(6, minmax(0,1fr));
}
.chantier-project-metrics-v21{
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.project-stats-grid-v21{
  grid-template-columns: repeat(8, minmax(0,1fr));
}

@media (max-width: 1399px){
  .dashboard-stats-grid-v21{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .dashboard-mini-stats-v21{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .project-stats-grid-v21{ grid-template-columns: repeat(4, minmax(0,1fr)); }
  .chantier-project-metrics-v21{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 767px){
  .dashboard-stats-grid-v21,
  .dashboard-mini-stats-v21,
  .project-stats-grid-v21,
  .chantier-project-metrics-v21{
    grid-template-columns: 1fr;
  }
}


/* ===== V2.2 fichiers / devis / factures ===== */
.entity-files-card{
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg,#ffffff,#fbfdff);
}
.entity-files-icon{
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 1.35rem;
  background: linear-gradient(135deg,#ede9fe,#ddd6fe);
}
.entity-files-stats{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:.8rem;
}
.entity-files-stat{
  background:#f8fbff;
  border:1px solid #e4eefb;
  border-radius:18px;
  padding:.9rem;
}
.entity-files-stat span{
  display:block;
  font-size:.8rem;
  color:#64748b;
  margin-bottom:.2rem;
}
.entity-files-stat strong{
  display:block;
  color:#0f172a;
  font-size:1rem;
}
.entity-files-input{
  border-radius:18px !important;
  border:1px solid #d9e2f1 !important;
  background: linear-gradient(180deg,#ffffff,#f8fbff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  padding:.9rem 1rem !important;
}
.entity-files-input:focus{
  border-color:#60a5fa !important;
  box-shadow:0 0 0 .25rem rgba(59,130,246,.14) !important;
}
.entity-files-btn{
  background: linear-gradient(135deg,#7c3aed,#2563eb);
  color:#fff;
  border:none;
  border-radius:16px;
  padding:.92rem 1.2rem;
  font-weight:700;
  box-shadow:0 10px 20px rgba(124,58,237,.18);
}
.entity-files-btn:hover{ color:#fff; filter:brightness(1.03); }
.entity-files-btn-soft{
  background:#eef4ff;
  color:#1d4ed8;
  border:1px solid #cfe0ff;
  border-radius:14px;
  padding:.55rem .85rem;
  font-weight:700;
}
.entity-files-btn-delete{
  background:#fff1f2;
  color:#be123c;
  border:1px solid #fecdd3;
  border-radius:14px;
  padding:.55rem .85rem;
  font-weight:700;
}
.entity-file-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  padding:1rem 0;
  border-top:1px solid #eef2f7;
}
.entity-file-row:first-child{
  border-top:none;
}
.entity-file-link{
  font-weight:700;
  color:#0f172a;
  text-decoration:none;
}
.entity-file-link:hover{ color:#1d4ed8; }
.entity-files-empty{
  border:2px dashed #cbd5e1;
  border-radius:24px;
  padding:1.2rem;
  text-align:center;
  color:#64748b;
  background:#f8fafc;
}
@media (max-width: 767px){
  .entity-files-stats{
    grid-template-columns:1fr 1fr;
  }
  .entity-file-row{
    flex-direction:column;
  }
}


/* ===== V2.2.1 fichiers / devis / factures ===== */
.entity-files-toolbar{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  gap:1rem;
  align-items:center;
}
.entity-files-filters{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
}
.entity-files-filter-btn{
  border:1px solid #dbe7f5;
  background:#f8fbff;
  color:#1e3a8a;
  border-radius:999px;
  padding:.6rem .9rem;
  font-weight:700;
}
.entity-files-filter-btn:hover{ background:#eef4ff; }
.entity-files-filter-btn.is-active{
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
  border-color:transparent;
}
.entity-files-search-wrap{ min-width:240px; }
.entity-file-pdf-chip{
  display:inline-flex;
  align-items:center;
  padding:.22rem .5rem;
  border-radius:999px;
  background:#fee2e2;
  color:#b91c1c;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.04em;
}
.entity-file-preview{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:.8rem .9rem;
}
.entity-file-preview summary{
  cursor:pointer;
  font-weight:700;
  color:#1d4ed8;
}
.entity-file-preview-frame-wrap{
  border-radius:16px;
  overflow:hidden;
  border:1px solid #dbe7f5;
  background:#fff;
}
.entity-file-preview-frame{
  width:100%;
  height:480px;
  border:0;
  display:block;
  background:#fff;
}
.entity-files-no-result{
  margin-top:1rem;
  border:2px dashed #cbd5e1;
  border-radius:20px;
  padding:1rem 1.2rem;
  text-align:center;
  color:#64748b;
  background:#f8fafc;
}
@media (max-width: 767px){
  .entity-files-toolbar{ grid-template-columns: 1fr; }
  .entity-file-preview-frame{ height:340px; }
}


/* ===== V2.2.2 files enhancements ===== */
.entity-files-toolbar-right{
  display:grid;
  grid-template-columns:minmax(240px,1fr) 190px;
  gap:.75rem;
  align-items:center;
}
.entity-files-sort-wrap{ min-width:180px; }

.entity-file-thumb-link{
  display:block;
  flex:0 0 auto;
}
.entity-file-thumb{
  width:78px;
  height:78px;
  border-radius:16px;
  object-fit:cover;
  border:1px solid #dbe7f5;
  background:#fff;
  box-shadow:0 6px 14px rgba(15,23,42,.08);
}
.entity-file-thumb-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:#475569;
  background:linear-gradient(135deg,#eef2ff,#f8fafc);
}
.entity-file-image-chip{
  display:inline-flex;
  align-items:center;
  padding:.2rem .55rem;
  border-radius:999px;
  background:#ecfdf5;
  color:#15803d;
  font-size:.74rem;
  font-weight:800;
  border:1px solid #bbf7d0;
}
.entity-file-actions{
  align-items:flex-start;
  justify-content:flex-end;
}
.entity-files-btn-download{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  border-radius:16px;
  padding:.6rem .9rem;
  font-weight:700;
}
.entity-files-btn-download:hover{
  color:#1d4ed8;
  background:#dbeafe;
}
.entity-file-image-preview-wrap{
  background:#f8fbff;
  border:1px solid #e5edf8;
  border-radius:18px;
  padding:.75rem;
}
.entity-file-image-preview{
  width:100%;
  max-height:520px;
  object-fit:contain;
  display:block;
  border-radius:12px;
  background:#fff;
}
@media (max-width: 767px){
  .entity-files-toolbar-right{
    grid-template-columns:1fr;
  }
  .entity-file-thumb,
  .entity-file-thumb-placeholder{
    width:64px;
    height:64px;
  }
}
