/* ==========================================================================
   ScanORDO Direct Hors HDS - Styles Dashboard (Pharmacien & Admin)
   ========================================================================== */

.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* En-tête du tableau de bord */
.navbar {
  background-color: var(--bg-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand .brand-logo {
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: white;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-brand .brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  text-align: right;
  font-size: 0.85rem;
}

.user-name {
  font-weight: 700;
  color: var(--text-dark);
}

.user-role {
  color: var(--text-muted);
}

.btn-logout {
  background-color: #f1f1f1;
  color: #c82333;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-normal);
}

.btn-logout:hover {
  background-color: #f8d7da;
}

/* Contenu principal */
.main-content {
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-dark);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Formulaire d'ajout rapide de comptoir */
.add-counter-card {
  background: var(--bg-white);
  padding: 20px 25px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 30px;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.add-counter-card input {
  flex: 1;
  min-width: 250px;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.add-counter-card input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 168, 107, 0.15);
}

.btn-add {
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-add:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Grille des comptoirs */
.counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.counter-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--primary-color);
  transition: var(--transition-normal);
}

.counter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.counter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.counter-name {
  font-size: 1.25rem;
  color: var(--text-dark);
}

.counter-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  background: #f1f1f1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  display: inline-block;
}

.counter-badge {
  background: rgba(40, 167, 69, 0.1);
  color: var(--status-success);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 6px;
}

.counter-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--status-success);
  border-radius: 50%;
}

.counter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-counter-open {
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition-normal);
}

.btn-counter-open:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-counter-qr {
  background: #eef4ff;
  color: var(--secondary-color);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-counter-qr:hover {
  background: #dce8fc;
}

.btn-counter-copy {
  background: #f8fafc;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-counter-copy:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.counter-footer {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-delete-counter {
  color: #dc3545;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.btn-delete-counter:hover {
  text-decoration: underline;
}

/* État vide */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Bandeau Abonnement & Période d'essai SaaS
   ========================================================================== */
.subscription-banner {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid #334155;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sub-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sub-badge {
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.sub-badge.badge-trial { background: #f59e0b; color: #1e1e1e; }
.sub-badge.badge-active { background: #10b981; color: white; }
.sub-badge.badge-expired { background: #ef4444; color: white; }

.sub-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.sub-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

.sub-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sub-plan {
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-normal);
  cursor: pointer;
}

.btn-sub-plan:hover {
  background: #008f5a;
  transform: translateY(-1px);
}

.btn-sub-promo {
  background: #334155;
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-sub-promo:hover {
  background: #475569;
  color: white;
}

/* Zone Code Promo dépliante */
.promo-box-container {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #334155;
}

.promo-form {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 480px;
}

.promo-input {
  background: #0f172a;
  border: 1px solid #475569;
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  flex: 1;
  text-transform: uppercase;
}

.promo-input:focus {
  border-color: #38bdf8;
  outline: none;
}

/* Navigation par Onglets */
.dashboard-nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-dark);
  background: #f1f5f9;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
  background: white;
}

/* Formulaire Fiche Officine */
.profile-card {
  background: white;
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 30px;
}

.profile-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input, .form-group select {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: var(--transition-normal);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.15);
  outline: none;
}

/* Bulle d'information CIP */
.info-tooltip-wrap {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.info-icon-badge {
  background: #0284c7;
  color: white;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.tooltip-popup {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  width: 250px;
  text-align: center;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  line-height: 1.35;
}

.tooltip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.info-tooltip-wrap:hover .tooltip-popup {
  visibility: visible;
  opacity: 1;
}

/* Menu déroulant d'autocomplétion d'adresse */
.address-suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.suggestion-item:hover {
  background: #f0fdf4;
  color: var(--primary-color);
  font-weight: 600;
}

.btn-save-profile {
  background: var(--primary-color);
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-save-profile:hover {
  background: #008f5a;
  transform: translateY(-1px);
}

/* ==========================================================================
   Architecture Espace Pharmacien Inspiree Darty (Menu Gauche + Grille Droite)
   ========================================================================== */
.darty-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f7f9fa;
}

.darty-breadcrumb {
  padding: 12px 30px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #6b7280;
}

.darty-breadcrumb a {
  color: #1f2937;
  text-decoration: none;
  font-weight: 500;
}

.darty-breadcrumb span {
  margin: 0 8px;
  color: #9ca3af;
}

.darty-container {
  display: flex;
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
  gap: 28px;
  width: 100%;
}

@media (max-width: 960px) {
  .darty-container {
    flex-direction: column;
    padding: 0 16px;
    gap: 20px;
  }
}

/* Colonne Gauche : Menu Darty */
.darty-sidebar {
  width: 270px;
  flex-shrink: 0;
}

.darty-profile-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--primary-color);
}

.darty-profile-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.darty-profile-cip {
  font-size: 0.75rem;
  color: #4b5563;
  font-family: monospace;
}

.darty-menu-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.darty-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: #374151;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.darty-nav-item:last-child {
  border-bottom: none;
}

.darty-nav-item:hover {
  background: #f9fafb;
  color: var(--primary-color);
}

.darty-nav-item.active {
  background: #f0fdf4;
  color: var(--primary-color);
  font-weight: 700;
  border-left: 3px solid var(--primary-color);
}

.darty-nav-arrow {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Colonne Droite : Contenu Principal */
.darty-main-content {
  flex: 1;
  min-width: 0;
}

/* Banniere Type Darty Max pour l'offre SaaS */
.darty-max-banner {
  background: linear-gradient(135deg, #18202c, #0d131a);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid #2d3748;
}

.darty-max-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.darty-max-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.darty-max-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 3px;
}

/* Encart Publicitaire BtoB Laboratoire */
.b2b-ad-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.b2b-ad-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-bottom: 4px;
}

.b2b-ad-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.b2b-ad-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.b2b-ad-cta {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0369a1;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.b2b-ad-cta:hover {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

/* Grille de statistiques ROI */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.stat-box-label {
  font-size: 0.72rem;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-box-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

.stat-box-sub {
  font-size: 0.72rem;
  color: #10b981;
  margin-top: 4px;
  font-weight: 600;
}

/* Carte signature "Ajout d'un Nouveau Comptoir" - Grand format visible */
.add-post-action-card {
  background: #f8fafc;
  border: 2.5px dashed #059669;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 240px;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.06);
}

.add-post-action-card:hover {
  border-color: #047857;
  background: #ecfdf5;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.15);
}

.add-post-plus {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #d1fae5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  transition: all 0.2s;
}

.add-post-action-card:hover .add-post-plus {
  background: #059669;
  color: white;
  transform: scale(1.08);
}

.add-post-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.add-post-desc {
  font-size: 0.92rem;
  color: #475569;
  max-width: 270px;
  line-height: 1.45;
}

/* ==========================================================================
   Styles Gestion Financiere Dirigeant Officine - Inspiration Pennylane
   ========================================================================== */
.penny-header-status {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.penny-header-status.status-good {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.penny-header-status.status-pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.penny-status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.penny-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
}

.penny-header-status.status-pending .penny-status-dot {
  background: #f59e0b;
}

.penny-status-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.penny-status-sub {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* Grille KPI Dirigeant */
.penny-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}

.penny-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.penny-kpi-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.penny-kpi-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.penny-kpi-sub {
  font-size: 0.75rem;
  color: #059669;
  margin-top: 4px;
  font-weight: 600;
}

/* Tableau des Factures & Justificatifs Comptables (Pennylane) & Tables d'Administration */
.invoices-table-card,
.table-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.invoices-table,
table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.invoices-table th,
table.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.invoices-table td,
table.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.invoices-table tr:last-child td,
table.admin-table tr:last-child td {
  border-bottom: none;
}

table.admin-table tr:hover {
  background-color: #f8fafc;
}

.badge-paid {
  background: #ecfdf5;
  color: #047857;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
}

.btn-invoice-pdf {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0284c7;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-invoice-pdf:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

/* ==========================================================================
   Console Diagnostic & Santé (Pédagogique, sans acronymes superflus)
   ========================================================================== */
.diag-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.diag-pillar-card {
  background: #ffffff;
  border: 1px solid var(--penny-border, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.diag-pillar-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.diag-pillar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.diag-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.diag-dot.dot-good {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.diag-dot.dot-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.diag-dot.dot-bad {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.diag-dot.dot-testing {
  background: #0284c7;
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.diag-pillar-title {
  font-size: 0.95rem;
  color: #0f172a;
}

.diag-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.diag-tag.tag-good {
  background: #ecfdf5;
  color: #047857;
}

.diag-tag.tag-warn {
  background: #fffbeb;
  color: #b45309;
}

.diag-tag.tag-bad {
  background: #fef2f2;
  color: #b91c1c;
}

.diag-pillar-metric {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.diag-pillar-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px;
  flex-grow: 1;
}

.diag-pillar-detail {
  font-size: 0.76rem;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}

/* Journal des événements & explications */
.diag-log-container {
  background: #ffffff;
  border: 1px solid var(--penny-border, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.diag-log-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
}

.diag-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diag-event-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.diag-event-row:hover {
  border-color: #cbd5e1;
}

.diag-event-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  background: #ffffff;
  user-select: none;
}

.diag-event-summary:hover {
  background: #f8fafc;
}

.diag-event-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diag-event-time {
  font-family: monospace;
  font-size: 0.78rem;
  color: #64748b;
}

.diag-event-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.diag-event-chevron {
  font-size: 0.78rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.diag-event-row.open .diag-event-chevron {
  transform: rotate(180deg);
}

.diag-event-detail {
  display: none;
  padding: 14px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #334155;
}

.diag-event-row.open .diag-event-detail {
  display: block;
}

.diag-detail-section {
  margin-bottom: 10px;
}

.diag-detail-section:last-child {
  margin-bottom: 0;
}

.diag-detail-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diag-code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.76rem;
  margin-top: 6px;
  word-break: break-all;
}

/* ==========================================================================
   Navigation Latérale Verticale (Style Moderne Pennylane / Doctolib)
   ========================================================================== */
.dashboard-vertical-container {
  display: flex;
  min-height: calc(100vh - 70px);
  width: 100%;
  background: #f8fafc;
}

.dashboard-sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 24px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-profile-snippet {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 20px;
}

.sidebar-profile-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-cip {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-nav-item:hover svg {
  color: #0f172a;
}

.sidebar-nav-item.active {
  background: #f0fdf4;
  color: #059669;
  border-color: #bbf7d0;
  font-weight: 700;
}

.sidebar-nav-item.active svg {
  color: #059669;
}

.dashboard-main-area {
  flex: 1;
  padding: 24px 32px;
  min-width: 0;
}

@media (max-width: 900px) {
  #sidebarToggleBtn {
    display: inline-flex !important;
  }

  .dashboard-vertical-container {
    position: relative;
    overflow-x: hidden;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
  }

  .dashboard-sidebar.mobile-open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .dashboard-main-area {
    padding: 16px;
    width: 100%;
  }

  .navbar {
    padding: 12px 16px;
  }
}

/* ==========================================================================
   Composant Fenêtre Modale (Remplace alert & confirm natifs)
   ========================================================================== */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  padding: 16px;
}

.app-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.app-modal-dialog {
  background: #ffffff;
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.18s ease;
}

.app-modal-overlay.open .app-modal-dialog {
  transform: scale(1);
}

.app-modal-header {
  padding: 16px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.app-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.app-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.app-modal-close:hover {
  color: #475569;
}

.app-modal-body {
  padding: 20px;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
}

.app-modal-body p {
  margin: 0;
}

.app-modal-footer {
  padding: 14px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.btn-modal-cancel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-cancel:hover {
  background: #f1f5f9;
}

.btn-modal-primary {
  background: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-primary:hover {
  background: #0369a1;
}

.btn-modal-danger {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-danger:hover {
  background: #b91c1c;
}



