:root{
  --primary:#7c3aed;
  --primary-light:#a78bfa;
  --bg:#f5f7fa;
  --surface:#ffffff;
  --text:#1f2937;
  --error:#ef4444;
  --radius:16px;
  --shadow:0 4px 20px rgba(0,0,0,.08);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;
}
body{margin:0;font-family:var(--font);background:var(--bg);color:var(--text);}
button{border:none;font-family:inherit;cursor:pointer;background:none;}
.ripple{position:relative;overflow:hidden;}
.ripple::before{content:'';position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:rgba(255,255,255,.5);transform:translate(-50%,-50%);transition:width .4s,height .4s;}
.ripple:active::before{width:300px;height:300px;}

/* ----- LOGIN ----- */
.login-body{display:flex;align-items:center;justify-content:center;height:100vh;background:linear-gradient(135deg,var(--primary-light),var(--primary));}
.login-card{background:var(--surface);padding:2.5rem 2rem;border-radius:var(--radius);box-shadow:var(--shadow);width:360px;text-align:center;}
.login-card .logo{font-size:1.5rem;font-weight:700;color:var(--primary);margin-bottom:1.5rem;}
.login-form{display:flex;flex-direction:gap:.75rem;}
input{width:100%;padding:.75rem 1rem;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:1rem;}
.btn-primary{width:100%;padding:.75rem;background:var(--primary);color:#fff;border-radius:8px;font-weight:600;transition:background .2s;}
.btn-primary:hover{background:#6d28d9;}
.error{margin-top:.5rem;color:var(--error);font-size:.875rem;}

/* ----- TOP / PILLS ----- */
.top-bar{display:flex;justify-content:space-between;align-items:center;padding:1rem 2rem;background:var(--surface);box-shadow:var(--shadow);}
.logo{font-weight:700;font-size:1.25rem;color:var(--primary);}
.btn-text{color:var(--primary);font-weight:500;padding:.5rem .75rem;border-radius:8px;transition:background .2s;}
.btn-text:hover{background:var(--bg);}
.tab-pills{display:flex;gap:.5rem;padding:.5rem 2rem;background:var(--surface);}
.pill{padding:.5rem 1rem;border-radius:999px;font-weight:500;color:var(--text);transition:background .2s, color .2s;}
.pill.active{background:var(--primary);color:#fff;}
.pill:not(.active):hover{background:var(--bg);}
.container{padding:2rem;}

/* ----- CARDS / TABLES ----- */
.cards-stack{display:flex;flex-direction:column;gap:1rem;}
.card-modern{background:var(--surface);padding:1.5rem;border-radius:var(--radius);box-shadow:var(--shadow);}
.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;}
.modern-table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);}
.modern-table th{background:var(--bg);padding:1rem;text-align:left;font-weight:600;}
.modern-table td{padding:1rem;border-bottom:1px solid #f3f4f6;}
tr:hover{background:#fafbfc;}
.metrics-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;}
.metrics-grid div{background:var(--surface);padding:1.5rem;border-radius:var(--radius);box-shadow:var(--shadow);text-align:center;}
.metrics-grid .value{font-size:2rem;font-weight:700;color:var(--primary);}
modal{background:var(--surface);padding:2rem;border-radius:var(--radius);box-shadow:var(--shadow);}
.hero img {display: block;margin: 0 auto;width: 100%;max-width: 150px;}
/* ------ Boutons d'action « Ajouter / Nouvelle facture » ------ */
.btn-add {
  display: inline-flex;          /* taille auto au contenu */
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  font-size: .95rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;          /* pill ultra-arrondi */
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
  transition: background .2s, box-shadow .2s;
}
.btn-add:hover {
  background: #6d28d9;
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
}
.btn-add:active {
  transform: scale(.96);
}
/* ------ MODALE AJOUT / EDIT ------ */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 90vw;
  box-shadow: var(--shadow);
}
.modal::backdrop {
  background: rgba(0,0,0,.45);
}
.modal label {
  display: block;
  margin: 1rem 0 .25rem;
  font-weight: 500;
}
.modal input,
.modal select {
  width: 100%;
  padding: .75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.pwd-box {
  position: relative;
}
.pwd-box input {
  padding-right: 1rem;
}
.togglePwd {
  position: absolute;
  right: .5rem;
  top: 37%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: .25rem .5rem;
  border-radius: 20px;
}
.togglePwd:hover {
  background: #6c28d9aa;
}
menu {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}
/* ---------- FACTURATION – design 2025 (respecte ton thème) ---------- */

/* bouton « Marquer comme envoyée » */
.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  transition: background .2s, color .2s, transform .2s;
  cursor: pointer;
}
.send-btn.sent {
  background: var(--pastel-green, #d1fae5);
  color: #ffffff;
  cursor: default;
}
.send-btn:not(.sent) {
  background: var(--pastel-orange, #fed7aa);
  color: #ffffff;
}
.send-btn:not(.sent):hover {
  background: #fbbf24;
  transform: scale(1.08);
}

/* bouton télécharger */
.btn-icon.download {
  background: var(--pastel-blue, #dbeafe);
  color: #ffffff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background .2s, transform .2s;
}
.btn-icon.download:hover {
  background: #93c5fd;
  transform: scale(1.08);
}

/* tableau ultra-arrondi */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}
.modern-table th {
  background: var(--bg);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}
.modern-table td {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
}
.modern-table tr:hover {
  background: #fafbfc;
}

/* filtres / recherche */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filters input,
.filters select {
  padding: .75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-xl);
  background: var(--surface);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-light);
}