﻿:root {
  /* Axylis Brand Palette */
  --navy-dark: #0f172a;
  --navy-navbar: #182232;
  --navy-card: #1e293b;
  --navy-hover: #243044;
  
  --axylis-orange: #e84924;
  --axylis-orange-hover: #d03d1a;
  --axylis-orange-light: #fff5f2;
  --axylis-orange-glow: rgba(232, 73, 36, 0.25);
  
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.mono {
  font-family: var(--font-mono);
}

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

/* --- NAVBAR WITH PROMINENT BT POWER LOGO --- */
.axylis-navbar {
  background-color: var(--navy-navbar);
  border-bottom: 1px solid #243044;
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  height: 52px;
}

.brand-logo {
  height: 42px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.fallback-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: 0.05em;
}

.brand-divider {
  width: 1px;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.2);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--axylis-orange);
  text-transform: uppercase;
}

.brand-app-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* --- STEPPER BAR --- */
.stepper-bar-container {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  box-shadow: var(--shadow-sm);
}

.stepper-track {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.2s ease;
}

.step-item.active {
  opacity: 1;
}

.step-item.completed {
  opacity: 0.9;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.step-item.active .step-circle {
  background: var(--axylis-orange);
  color: white;
  border-color: var(--axylis-orange);
  box-shadow: 0 0 0 4px var(--axylis-orange-glow);
}

.step-item.completed .step-circle {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.step-text {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.step-item.active .step-label {
  color: var(--axylis-orange);
}

.step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 16px;
  transition: all 0.2s ease;
}

.step-connector.completed {
  background: var(--success);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-nav {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--axylis-orange);
  color: white;
}

.btn-axylis-primary {
  background: var(--axylis-orange);
  color: white;
  box-shadow: 0 2px 6px var(--axylis-orange-glow);
  font-weight: 700;
}

.btn-axylis-primary:hover {
  background: var(--axylis-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--axylis-orange-glow);
}

.btn-axylis-export {
  background: linear-gradient(135deg, #258a7e 0%, #36a495 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(37, 138, 126, 0.28);
  font-weight: 700;
}

.btn-axylis-export:hover {
  background: linear-gradient(135deg, #1e756b 0%, #2c8c7f 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 138, 126, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f1f5f9;
}

/* --- MAIN CONTENT --- */
.app-main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.axylis-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.step-card {
  padding: 28px;
}

.step-card-header {
  margin-bottom: 24px;
}

.step-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--axylis-orange);
  background: var(--axylis-orange-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.step-card-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --- STEP 1 : CLIENTS STYLES --- */
.clients-status-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 22px;
  transition: all 0.2s ease;
}

.status-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-info h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  word-break: break-word;
}

.status-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-subdetail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step1-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 1100px) {
  .step1-options-grid {
    grid-template-columns: 1fr;
  }
}

.option-choice {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
}

.option-choice:hover {
  border-color: var(--border-subtle);
  background: #fdfdfd;
}

.option-choice.selected {
  border-color: var(--axylis-orange);
  background: var(--axylis-orange-light);
}

.choice-radio input {
  margin-top: 4px;
  accent-color: var(--axylis-orange);
  cursor: pointer;
  transform: scale(1.2);
}

.choice-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.choice-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.choice-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-help-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--navy-navbar);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.btn-help-icon:hover {
  background: var(--axylis-orange-light);
  border-color: var(--axylis-orange);
  color: var(--axylis-orange);
}

/* --- STEP 2 : COMPATIBILITY BANNER & DROP ZONE --- */
.compatibility-banner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.compatibility-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy-navbar);
}

.compatibility-title svg {
  color: var(--success);
}

.compatibility-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compatibility-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  height: 42px;
}

.comp-logo {
  height: 28px;
  max-width: 100px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* --- DROP ZONE --- */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 50px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--axylis-orange);
  background: var(--axylis-orange-light);
}

.drop-zone-icon {
  color: var(--axylis-orange);
  margin-bottom: 12px;
}

.drop-zone h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drop-zone p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.drop-zone.mini {
  padding: 20px 16px;
  margin-top: 12px;
}

/* --- STEP ACTIONS BAR --- */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* --- STEP 3 : RESULTS TOP BAR --- */
.step3-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.step3-top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- CLEAN KPI GRID (RESPONSIVE & NO WRAP) --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

.kpi-card {
  background: var(--card-bg);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 3px solid var(--navy-navbar);
  min-width: 0;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.kpi-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.highlight-card {
  border-top-color: var(--axylis-orange);
  background: linear-gradient(135deg, #ffffff 0%, #fff8f6 100%);
}

.balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--success-text);
  background: var(--success-bg);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  width: fit-content;
  border: 1px solid var(--success-border);
  margin-top: 2px;
  white-space: nowrap;
}

.balance-badge.unbalanced {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

/* --- ALERTS --- */
.alert {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.client-tag {
  background: #ffffff;
  border: 1px solid var(--warning-border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warning-text);
}

/* --- DATA TABLE --- */
.table-card {
  display: flex;
  flex-direction: column;
}

.table-header-bar {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.search-and-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  width: 280px;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  font-family: var(--font-sans);
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

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

.filter-btn.active {
  background: var(--navy-navbar);
  color: white;
  border-color: var(--navy-navbar);
}

.filter-btn.filter-warning.active {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.table-wrapper {
  overflow-x: auto;
  max-height: 600px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: var(--navy-navbar);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  z-index: 10;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.text-right {
  text-align: right;
}

.badge-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-client {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.badge-new-client {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-vente {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-tva {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.table-footer-bar {
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.table-totals {
  display: flex;
  gap: 20px;
  color: var(--text-main);
  white-space: nowrap;
}

/* --- LOADER MODAL (CLEAN & NO CUTS) --- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.loader-card {
  background: #ffffff;
  padding: 38px 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--axylis-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.loader-path-badge {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--navy-navbar);
  font-weight: 600;
  width: fit-content;
  max-width: 100%;
  line-height: 1.4;
  margin-top: 4px;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- MODAL BASE --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 740px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--navy-navbar);
  color: white;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: white;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* --- CLEAN MODAL FORM STYLES --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

.form-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy-navbar);
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.form-group input.mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

.form-group input:focus {
  outline: none;
  border-color: var(--axylis-orange);
  box-shadow: 0 0 0 3px var(--axylis-orange-glow);
}

.form-group .help-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* --- ARCHIVE / HISTORY MODAL --- */
.history-modal-card {
  max-width: 840px;
  width: 95%;
}

.history-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.history-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: all 0.15s ease;
}

.history-card-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-navbar);
  word-break: break-all;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.history-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-download-archive {
  background: white;
  border: 1px solid var(--border-subtle);
  color: var(--navy-navbar);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download-archive:hover {
  background: var(--axylis-orange-light);
  border-color: var(--axylis-orange);
  color: var(--axylis-orange);
}

/* --- HELP MODAL --- */
.help-modal-card {
  max-width: 960px;
  width: 95%;
}

.help-modal-body {
  padding: 24px;
}

.help-modal-instruction {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 16px;
  line-height: 1.5;
}

.help-screenshot-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #f8fafc;
}

.help-screenshot-img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- FOOTER WITH DIRECT AXYLIS LOGO --- */
.app-footer {
  padding: 16px 28px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-axylis-logo-direct {
  height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px var(--axylis-orange-glow);
  display: block;
}

/* ─── Pennylane Push Button ──────────────────────────────── */
.btn-pennylane {
  background: linear-gradient(135deg, #007872 0%, #0F5757 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 120, 114, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-pennylane:hover {
  background: linear-gradient(135deg, #00635e 0%, #0a4444 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 120, 114, 0.5);
}
.btn-pennylane:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Pennylane Push Toast ────────────────────────────────── */
#plToast {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  gap: 10px;
  align-items: flex-start;
  flex-direction: column;
  animation: toastIn 0.3s ease;
}
#plToast.show { display: flex; }
#plToast.success { background: #22c55e; color: #fff; }
#plToast.error { background: #ef4444; color: #fff; }
#plToast.info { background: #0F5757; color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Pennylane Buttons SVG Icon Color (#00F872) ─────────── */
.btn-axylis-export svg,
.btn-pennylane svg {
  stroke: #00F872 !important;
  color: #00F872 !important;
}

/* ─── New Batch Button (Red Icon Only) ────────────────────── */
#btnNewBatch {
  padding: 8px 12px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#btnNewBatch svg {
  stroke: #ef4444 !important;
  color: #ef4444 !important;
  transition: transform 0.2s ease;
}
#btnNewBatch:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
#btnNewBatch:hover svg {
  transform: rotate(-30deg);
}


/* ─── Multi-Structure Navbar Selector ────────────────────── */
.structure-selector-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 87, 87, 0.08);
  border: 1.5px solid rgba(15, 87, 87, 0.25);
  border-radius: 8px;
  padding: 5px 12px;
  color: #0F5757;
  font-weight: 700;
  font-size: 0.88rem;
}
.structure-badge-label {
  color: #0F5757;
  font-weight: 700;
}
.structure-nav-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
  color: #0F5757;
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
}
.structure-nav-select:focus {
  border-color: #0F5757;
  box-shadow: 0 0 0 2px rgba(15, 87, 87, 0.2);
}

/* ─── Modal Multi-Structures Tabs ────────────────────────── */
.modal-card-lg {
  max-width: 820px !important;
}
.modal-struct-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 18px;
  gap: 12px;
}
.struct-tabs-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.struct-pill-btn {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.struct-pill-btn:hover {
  background: #e2e8f0;
}
.struct-pill-btn.active {
  background: #0F5757;
  border-color: #0F5757;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 87, 87, 0.3);
}
.struct-section-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0F5757;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #fca5a5;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger-outline:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* ─── Cadrage Entité Banner in Step 3 ─────────────────────── */
.cadrage-banner-wrapper {
  margin-bottom: 20px;
}
.cadrage-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
}
.cadrage-banner-inner.success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}
.cadrage-banner-inner.danger {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}
.cadrage-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.cadrage-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cadrage-title {
  font-size: 0.98rem;
  font-weight: 800;
}
.cadrage-mismatch-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.mismatch-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── History Tabs & Audit Logs ──────────────────────────── */
.history-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
}
.history-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 16px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: -2px;
}
.history-tab-btn.active {
  color: #0F5757;
  border-bottom-color: #0F5757;
}
.structure-filter-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.logs-table th {
  background: #f8fafc;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1.5px solid #cbd5e1;
  color: #475569;
}
.logs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.log-status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}
.log-status-badge.ok { background: #dcfce7; color: #15803d; }
.log-status-badge.err { background: #fee2e2; color: #b91c1c; }


/* ─── Modern Segmented Structure Switcher ────────────────── */
.structure-switcher-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 40px;
  padding: 4px 6px 4px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.switcher-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.structure-segmented-control {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 30px;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.struct-pill-btn-nav {
  background: transparent;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.struct-pill-btn-nav:hover:not(.active) {
  background: rgba(15, 87, 87, 0.08);
  color: #0F5757;
}
.struct-pill-btn-nav.active {
  background: #0F5757;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 87, 87, 0.35);
}
.struct-pill-btn-nav .pill-active-dot {
  width: 7px;
  height: 7px;
  background: #00F872;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #00F872;
}

/* ─── Orange Button for + Ajouter une structure ──────────────── */
#btnAddNewStructure {
  background: var(--axylis-orange, #e84924) !important;
  color: #ffffff !important;
  border: 1px solid var(--axylis-orange, #e84924) !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  box-shadow: 0 2px 6px rgba(232, 73, 36, 0.3) !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
}

#btnAddNewStructure:hover {
  background: var(--axylis-orange-hover, #d03d1a) !important;
  border-color: var(--axylis-orange-hover, #d03d1a) !important;
  box-shadow: 0 4px 12px rgba(232, 73, 36, 0.4) !important;
  transform: translateY(-1px);
}


/* ─── Compact Cogwheel Icon-Only Button in Navbar ─────────────── */
#btnOpenConfig.btn-cog-icon {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
}

#btnOpenConfig.btn-cog-icon svg {
  transition: transform 0.35s ease !important;
}

#btnOpenConfig.btn-cog-icon:hover svg {
  transform: rotate(60deg) !important;
}


/* ─── Optional Clients Accordion on Upload Screen ─────────── */
.optional-clients-accordion {
  margin-top: 24px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
  transition: all 0.2s ease;
}
.optional-clients-accordion:hover {
  border-color: #94a3b8;
}
.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
}
.acc-title-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #334155;
}
.acc-badge {
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.accordion-arrow {
  color: #64748b;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}
.accordion-arrow.open {
  transform: rotate(180deg);
}
.accordion-body {
  padding: 16px 18px;
  border-top: 1px solid #e2e8f0;
}


/* ─── Modern Directory Processing Card ────────────────────── */
.network-folder-card {
  margin-top: 24px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.network-folder-header {
  margin-bottom: 14px;
}
.network-folder-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.folder-icon-circle {
  width: 38px;
  height: 38px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F5757;
  flex-shrink: 0;
}
.network-folder-title strong {
  display: block;
  font-size: 0.96rem;
  color: #1e293b;
}
.folder-subtitle {
  display: block;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}
.network-folder-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-folder-browse {
  background: #ffffff;
  color: #0F5757;
  border: 1.5px solid #0F5757;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-folder-browse:hover {
  background: #0F5757;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 87, 87, 0.25);
  transform: translateY(-1px);
}
.folder-divider {
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}
.folder-input-wrapper {
  flex: 1;
  display: flex;
  gap: 8px;
  min-width: 320px;
}
.folder-path-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.86rem;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s ease;
}
.folder-path-input:focus {
  background: #ffffff;
  border-color: #0F5757;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 87, 87, 0.1);
}
.btn-scan-folder {
  padding: 9px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}


/* ─── Compact PDF Queue Summary Card ─────────────────────── */
.pdf-queue-card {
  margin-top: 18px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 16px 22px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}
.pdf-queue-summary-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.queue-summary-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.queue-check-icon {
  width: 40px;
  height: 40px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}
.queue-text-info {
  display: flex;
  flex-direction: column;
}
.queue-count-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: #065f46;
}
.queue-size-label {
  font-size: 0.85rem;
  color: #047857;
  font-family: var(--font-mono);
  margin-top: 2px;
}
.queue-summary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* ─── Premium Pennylane Confirmation Modal ─────────────────── */
.modal-pennylane-confirm {
  max-width: 540px;
  width: 92%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(15, 87, 87, 0.15);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 !important;
}
@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.pl-confirm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #0F5757 0%, #173d3d 100%);
  color: #ffffff;
  position: relative;
}
.pl-confirm-icon-badge {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00F872;
  flex-shrink: 0;
  border: 1px solid rgba(0, 248, 114, 0.3);
}
.pl-confirm-title-area h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}
.pl-confirm-title-area p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}
.pl-confirm-header .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.pl-confirm-header .modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.pl-confirm-body {
  padding: 22px 24px;
  background: #ffffff;
}
.pl-confirm-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.pl-summary-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
}
.pl-summary-item.full-width {
  grid-column: span 2;
}
.pl-item-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}
.pl-item-val {
  font-size: 0.95rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-item-val strong {
  font-weight: 700;
}
.pl-item-sub {
  font-size: 0.85rem;
  color: #64748b;
  font-family: var(--font-mono);
}
.pl-confirm-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.83rem;
  color: #0369a1;
  line-height: 1.45;
}
.pl-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.btn-pennylane-submit {
  background: #0F5757;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(15, 87, 87, 0.25);
}
.btn-pennylane-submit:hover {
  background: #146f6f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 87, 87, 0.35);
}


/* ─── Login Screen & Profile Selector ─────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}
.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: 18px;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-header {
  padding: 26px 28px 20px;
  background: linear-gradient(135deg, #182232 0%, #0F5757 100%);
  color: #ffffff;
  text-align: center;
}
.login-logos {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 24px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.login-logo-bt {
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
}
.login-divider-v {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.4);
}
.login-brand-tag {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}
.login-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}
.login-header p {
  font-size: 0.84rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}
.login-body {
  padding: 24px 28px;
  background: #ffffff;
}
.login-section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 10px;
}
.profile-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.profile-card.selected {
  background: #e6f6f5;
  border-color: #0F5757;
  box-shadow: 0 0 0 2px rgba(15, 87, 87, 0.2);
}
.profile-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.profile-card.selected .profile-card-icon {
  background: #0F5757;
  color: #ffffff;
  border-color: #0F5757;
}
.profile-card-info {
  flex: 1;
}
.profile-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-card.selected .profile-card-name {
  color: #0F5757;
}
.profile-card-role-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
}
.profile-card-role-tag.admin {
  background: #fef3c7;
  color: #b45309;
}
.profile-card-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}
.login-pin-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.login-pin-input {
  width: 100%;
  padding: 10px 42px 10px 14px;
  font-size: 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.2s ease;
}
.login-pin-input:focus {
  background: #ffffff;
  border-color: #0F5757;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 87, 87, 0.12);
}
.btn-toggle-pin {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.6;
}
.btn-toggle-pin:hover {
  opacity: 1;
}
.login-hint-text {
  font-size: 0.76rem;
  color: #64748b;
  font-family: var(--font-mono);
}
.login-alert-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}
.btn-login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  justify-content: center;
}
.login-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 0.76rem;
  color: #64748b;
}

/* ─── Navbar User Badge & Logout ─────────────────────────── */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: none;
}
.user-role-icon {
  font-size: 0.95rem;
}
.user-name-text {
  white-space: nowrap;
}
.btn-logout-icon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-logout-icon:hover {
  background: #e84924;
  color: #ffffff;
  transform: scale(1.08);
}

/* ─── Admin Modal Tabs ───────────────────────────────────── */
.admin-modal-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1.5px solid #e2e8f0;
  padding: 0 16px;
}
.admin-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-tab-btn:hover {
  color: #1e293b;
}
.admin-tab-btn.active {
  color: #0F5757;
  border-bottom-color: #0F5757;
  background: #ffffff;
}
.users-list-table-wrapper {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.users-table th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.users-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}


/* ─── Classic Login Field Wrappers ───────────────────────── */
.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}
.login-field-input {
  width: 100%;
  padding: 10px 40px 10px 38px !important;
  font-size: 0.94rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.2s ease;
}
.login-field-input:focus {
  background: #ffffff;
  border-color: #0F5757;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 87, 87, 0.12);
}
.login-forgot-link:hover {
  text-decoration: underline !important;
}

/* ─── Role Radio Cards in User Form ──────────────────────── */
.role-radio-card {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
}
.role-radio-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.role-radio-card:has(input:checked) {
  border-color: #0F5757;
  background: #e6f6f5;
  box-shadow: 0 0 0 1px #0F5757;
}
.role-radio-card input {
  margin-top: 3px;
}
.btn-user-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: #1e293b;
  transition: all 0.15s ease;
}
.btn-user-action:hover {
  background: #e2e8f0;
}
.btn-user-delete {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}
.btn-user-delete:hover {
  background: #fee2e2;
  border-color: #f87171;
}


/* Nested Sub-modals Z-Index hierarchy */
#modalUserForm {
  z-index: 10050 !important;
}
#modalForgotPassword {
  z-index: 10050 !important;
}
#modalStructureMismatch {
  z-index: 10060 !important;
}


/* --- ROLE SEGMENTED CONTROL & STRUCTURE SELECTION UPGRADE --- */
.role-segmented-control {
  display: flex;
  background: #eef2f6;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #dbe2ea;
  gap: 6px;
}

.role-segment-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.role-radio-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.role-segment-tab:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.7);
}

.role-segment-tab.active {
  background: #ffffff;
  color: #0F5757;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.role-tab-icon {
  font-size: 1.15rem;
}

.role-hint-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0F5757;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
}

.role-hint-icon {
  font-size: 1.25rem;
}

.role-hint-body strong {
  display: block;
  font-size: 0.84rem;
  color: #0F5757;
  margin-bottom: 2px;
}

.role-hint-body p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}

.struct-pill-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.struct-pill-checkbox-item:hover {
  border-color: #0F5757;
  background: #f8fafc;
}

.struct-pill-checkbox-item.checked {
  border-color: #0F5757;
  background: #e6f6f5;
}

.struct-pill-badge {
  display: inline-block;
  background: #0F5757;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

#modalUserAccessSent { z-index: 10090 !important; }


/* ─── SLEEK & STREAMLINED USERS MANAGEMENT TABLE ─────────── */
.btn-add-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0F5757;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 87, 87, 0.15);
}
.btn-add-user:hover {
  background: #166e6e;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 87, 87, 0.22);
}

.users-list-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.users-table th {
  background: #f8fafc;
  padding: 10px 18px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.users-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tbody tr {
  transition: background 0.15s ease;
}

.users-table tbody tr:hover {
  background: #fafbfc;
}

/* User identity cell */
.user-cell-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-cell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6f4f1;
  color: #0F5757;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  border: 1px solid rgba(15, 87, 87, 0.15);
}

.user-cell-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-cell-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9rem;
}

.user-cell-sub {
  font-size: 0.77rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-cell-email {
  color: #64748b;
}

.user-cell-username {
  color: #94a3b8;
  font-size: 0.75rem;
}

.user-meta-dot {
  color: #cbd5e1;
}

/* Role tags */
.user-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role-tag.role-admin {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.user-role-tag.role-collab {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Access Pills */
.user-access-pill-all {
  display: inline-flex;
  align-items: center;
  color: #0F5757;
  font-weight: 600;
  font-size: 0.82rem;
}

.user-structs-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.user-struct-chip {
  display: inline-block;
  padding: 2px 7px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
}

/* Action Buttons */
.btn-user-action {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s ease;
}

.btn-user-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-user-delete {
  color: #ef4444;
  border-color: #fecaca;
  background: #fff;
  padding: 5px 9px;
  margin-left: 6px;
}

.btn-user-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}


/* ─── Panneau Acomptes & contrôles (acomptes-panel.js) ─── */
.acp-title { margin: 8px 0 2px; }
.acp-list { margin: 0 0 6px 18px; padding: 0; }
.acp-list li { margin: 4px 0 8px; }
.acp-row { margin-bottom: 4px; }
.acp-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acp-btn { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid #d97706; background: #fff7ed; color: #9a3412; cursor: pointer; }
.acp-btn:hover { background: #ffedd5; }
.acp-btn-primary { background: #0f766e; border-color: #0f766e; color: #fff; }
.acp-btn-primary:hover { background: #115e59; }
.acp-btn-ghost { background: transparent; border-color: #cbd5e1; color: #475569; }
.acp-btn-ghost:hover { background: #f1f5f9; }
.acp-decision { font-size: 12px; color: #0f766e; font-weight: 600; margin-left: 6px; }
.acp-lier { margin-top: 6px; }
.acp-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px dashed #d97706; border-radius: 8px; background: #fffbeb; }
.acp-form label { font-size: 12px; font-weight: 600; }
.acp-select, .acp-in { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; max-width: 100%; }
.acp-select { min-width: 320px; }
.acp-manual { display: flex; flex-wrap: wrap; gap: 6px; }
.acp-in { width: 150px; }
.acp-hint { font-size: 11px; color: #64748b; }
.acp-footer { margin: 8px 0 0; font-size: 11px; color: #64748b; }


/* ─── Envoi Pennylane : préflight, compte rendu, logs (pennylane-push.js) ─── */
.plp-host { display: block !important; }
.plp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; margin-bottom: 8px; }
.plp-k { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.plp-sub { font-size: 11px; color: #64748b; }
.plp-ok { color: #15803d; font-weight: 600; }
.plp-ko { color: #b91c1c; font-weight: 600; }
.plp-block { margin-top: 10px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; font-size: 13px; }
.plp-block-ko { border-color: #fca5a5; background: #fef2f2; }
.plp-block ul { margin: 4px 0 0 18px; padding: 0; }
.plp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.plp-table th, .plp-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.plp-table th { font-size: 11px; color: #64748b; font-weight: 600; }
.plp-row-ko td { background: #fff7ed; }
.plp-acc { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; max-width: 320px; }
.plp-acc-free { font: inherit; font-size: 11px; padding: 3px 6px; border: 1px solid #e2e8f0; border-radius: 6px; margin-left: 6px; width: 170px; }
.plp-check { display: block; margin-top: 10px; font-size: 13px; }
.pl-confirm-body .plp-table { max-height: 260px; }
#pennylaneResultPanel .alert-content { width: 100%; }


/* ─── Fenêtre Pennylane : version large et simplifiée (pennylane-push.js) ─── */
.modal-backdrop .modal-card.modal-pennylane-confirm { max-width: 980px; width: 94vw; max-height: 92vh; display: flex; flex-direction: column; }
.modal-pennylane-confirm .pl-confirm-body { overflow-y: auto; flex: 1 1 auto; padding: 18px 24px; }
.modal-pennylane-confirm .pl-confirm-footer { flex: 0 0 auto; gap: 10px; }
#plpContainer { font-size: 14px; color: #0f172a; }
.plp-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px 20px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.plp-head > div { min-width: 0; }
.plp-head .plp-k { display: block; margin-bottom: 2px; }
.plp-head strong { font-size: 15px; }
.plp-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.plp-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13px; font-weight: 600; }
.plp-pill-ok { background: #dcfce7; color: #166534; }
.plp-pill-ko { background: #fee2e2; color: #991b1b; }
.plp-section { margin-top: 14px; }
.plp-section-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.plp-details { border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 12px; background: #fff; }
.plp-details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #334155; }
.plp-details[open] summary { margin-bottom: 6px; }
.plp-acc-row { display: grid; grid-template-columns: minmax(220px, 1fr) 24px minmax(320px, 1.6fr); align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 6px; background: #fff; }
.plp-acc-row-ko { border-color: #fdba74; background: #fff7ed; }
.plp-acc-app { min-width: 0; line-height: 1.3; }
.plp-acc-app .mono { font-weight: 700; }
.plp-acc-arrow { text-align: center; color: #94a3b8; font-size: 16px; }
.plp-acc-pl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.plp-acc-pl .plp-acc { flex: 1 1 320px; max-width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.plp-acc-pl .plp-acc-free { flex: 1 1 220px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; margin: 0; width: auto; }
.plp-acc-state { font-size: 12px; white-space: nowrap; }
.plp-right { text-align: right; }
.plp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.plp-dot-ok { background: #16a34a; }
.plp-dot-ko { background: #dc2626; }
.plp-dot-grey { background: #94a3b8; }
.plp-piece-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
#plpContainer .plp-table th, #plpContainer .plp-table td { padding: 6px 8px; font-size: 13px; }
#plpContainer .plp-table th { font-size: 12px; }


/* ─── Panneau Acomptes & contrôles, version tableau (acomptes-panel.js) ─── */
#acompteAlert .alert-content { width: 100%; }
.acp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.acp-head strong { font-size: 15px; margin-right: 4px; }
.acp-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 600; }
.acp-pill-ok { background: #dcfce7; color: #166534; }
.acp-pill-ko { background: #fee2e2; color: #991b1b; }
.acp-section { margin-top: 6px; }
.acp-section-ko { border: 1px solid #fca5a5; background: #fff5f5; border-radius: 10px; padding: 10px 12px; }
.acp-section-title { font-weight: 700; font-size: 13px; color: #991b1b; margin-bottom: 8px; }
.acp-item { padding: 8px 0; border-top: 1px solid #fecaca; }
.acp-item:first-of-type { border-top: 0; padding-top: 0; }
.acp-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acp-piece { font-weight: 700; }
.acp-client { font-weight: 600; }
.acp-item-alert { margin: 4px 0; font-size: 13px; color: #7f1d1d; }
.acp-sub { font-size: 12px; color: #64748b; }
.acp-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.acp-badge-acompte { background: #ede9fe; color: #5b21b6; }
.acp-badge-reprise { background: #dbeafe; color: #1e40af; }
.acp-badge-rg { background: #fef3c7; color: #92400e; }
.acp-details { margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 12px; background: #fff; }
.acp-details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #334155; }
.acp-details[open] summary { margin-bottom: 6px; }
.acp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acp-table th, .acp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.acp-table th { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.acp-table tr:last-child td { border-bottom: 0; }
.acp-actions-row td { background: #f8fafc; }
.acp-right { text-align: right; white-space: nowrap; }
.acp-footer { margin-top: 8px; font-size: 11px; color: #64748b; }


/* Sous-titre du KPI chiffre d'affaires (acomptes hors CA) */
.kpi-sub { display: block; margin-top: 4px; font-size: 11px; color: #64748b; font-weight: 500; }

/* ─── Aperçu PDF des pièces ─────────────────────────────────────────────── */
/* Bouton « PDF » (bleu clair) présent dans le panneau acomptes et dans la grille */
.btn-pdf-apercu {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin: 0 2px;
  font-size: 12px; font-weight: 600; line-height: 1;
  color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
}
.btn-pdf-apercu:hover { background: #dbeafe; border-color: #93c5fd; }
.btn-pdf-apercu:disabled,
.btn-pdf-indispo {
  color: #94a3b8; background: #f1f5f9; border-color: #e2e8f0;
  cursor: not-allowed; opacity: 0.7;
}
/* Variante compacte pour la grille des écritures */
.btn-pdf-mini,
.col-pdf .btn-pdf-apercu { padding: 2px 8px; font-size: 11px; }
.col-pdf { width: 1%; white-space: nowrap; text-align: center; }

/* Fenêtre d'aperçu par-dessus la page */
.pdf-viewer-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.pdf-viewer-card {
  width: 96vw; height: 94vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.pdf-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.pdf-viewer-title { font-weight: 700; color: #1e293b; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-head-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.pdf-viewer-newtab { font-size: 12px; font-weight: 600; color: #1d4ed8; text-decoration: none; }
.pdf-viewer-newtab:hover { text-decoration: underline; }
.pdf-viewer-close {
  border: none; background: #e2e8f0; color: #334155; border-radius: 6px;
  width: 28px; height: 28px; font-size: 14px; cursor: pointer;
}
.pdf-viewer-close:hover { background: #cbd5e1; }
.pdf-viewer-frame { flex: 1 1 auto; width: 100%; border: 0; }
