/* ============================================
   STARTELEC DEVIS — style.css
   Charte : Anthracite #0F1820 + Rouge #961414
   ============================================ */

:root {
  --rouge:       #961414;
  --rouge-hover: #7a1010;
  --rouge-light: #F5E8E8;
  --anthracite:  #0F1820;
  --sidebar-bg:  #0a0f14;
  --sidebar-hover: #1a2a3a;
  --sidebar-border: #1e2d3d;
  --gris-moyen:  #4A4A4A;
  --gris-clair:  #F2F2F2;
  --gris-bord:   #D0D0D0;
  --gris-texte:  #1A1A1A;
  --gris-sub:    #666666;
  --blanc:       #ffffff;
  --bg-page:     #f5f6f8;
  --texte:       #1A1A1A;
  --texte-sec:   #666666;
  --border:      #e0e0e0;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--texte);
  background: var(--bg-page);
  line-height: 1.5;
}

/* ── LAYOUT ── */
.app-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  width: 220px;
  min-width: 220px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
}

.sidebar-logo span {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar-logo .logo-sub {
  color: var(--rouge);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}

.nav-section {
  padding: 16px 14px 6px;
  font-size: 10px;
  color: #4a6080;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  margin: 1px 8px;
  border-radius: var(--radius);
  color: #8aa0b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--rouge);
  color: #fff;
}

.nav-item svg, .nav-item i {
  width: 17px;
  height: 17px;
  font-size: 17px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--rouge);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rouge);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-name {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: #4a6080;
  font-size: 10px;
}

/* ── MAIN ── */
.main-content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--blanc);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--texte);
}

.topbar-breadcrumb {
  font-size: 13px;
  color: var(--texte-sec);
}

.topbar-breadcrumb span {
  color: var(--texte);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── BARRE ACTIONS DEVIS ── */
.action-bar {
  background: var(--blanc);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.action-bar .separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.statut-badge-bar {
  margin-left: auto;
}

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ── BOUTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--rouge);
  color: #fff;
  border-color: var(--rouge);
}
.btn-primary:hover { background: var(--rouge-hover); border-color: var(--rouge-hover); }

.btn-secondary {
  background: var(--blanc);
  color: var(--texte);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--gris-clair); }

.btn-ghost {
  background: transparent;
  color: var(--texte-sec);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gris-clair); color: var(--texte); }

.btn-danger {
  background: #fff;
  color: #c0392b;
  border-color: #f5c6cb;
}
.btn-danger:hover { background: #fff0f0; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 7px;
  width: 34px;
  height: 34px;
  justify-content: center;
}

/* Dropdown */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}

.dropdown-menu.right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--texte);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--gris-clair); }
.dropdown-item.danger { color: #c0392b; }
.dropdown-item.danger:hover { background: #fff0f0; }
.dropdown-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* ── STATS CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stat-card-label {
  font-size: 12px;
  color: var(--texte-sec);
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--texte);
  line-height: 1.2;
}

.stat-card-value.rouge { color: var(--rouge); }
.stat-card-value.vert  { color: #0F6E56; }
.stat-card-value.orange { color: #BA7517; }

.stat-card-sub {
  font-size: 11px;
  color: var(--texte-sec);
  margin-top: 4px;
}

.stat-card.accent {
  border-left: 3px solid var(--rouge);
}

/* ── TABLEAU DASHBOARD ── */
.table-container {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--texte);
}

.table-filters {
  display: flex;
  gap: 6px;
  align-items: center;
}

.filter-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--blanc);
  color: var(--texte-sec);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--rouge); color: var(--rouge); }
.filter-pill.active { background: var(--rouge); color: #fff; border-color: var(--rouge); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-sec);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #fafafa; }

.data-table tbody td {
  padding: 11px 14px;
  color: var(--texte);
  vertical-align: middle;
}

.td-num { color: var(--rouge); font-weight: 600; font-size: 13px; }
.td-client { font-weight: 500; }
.td-montant { font-weight: 600; }
.td-sec { color: var(--texte-sec); font-size: 12px; }
.td-produit { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte-sec); font-size: 12px; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.table-footer-totals {
  display: flex;
  gap: 24px;
  font-size: 13px;
}

.table-footer-totals .t-item span { color: var(--texte-sec); }
.table-footer-totals .t-item strong { color: var(--texte); }
.table-footer-totals .t-item strong.rouge { color: var(--rouge); }

/* ── BADGES STATUT ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-cree      { background: #F1EFE8; color: #5F5E5A; }
.badge-envoye    { background: #E6F1FB; color: #185FA5; }
.badge-accepte   { background: #D1F5E0; color: #0F6E56; }
.badge-refuse,
.badge-rejete    { background: #FCEBEB; color: #A32D2D; }
.badge-paye      { background: #D1F5E0; color: #0F6E56; }
.badge-partiel   { background: #FAEEDA; color: #854F0B; }
.badge-annule    { background: #F1EFE8; color: #5F5E5A; }
.badge-acompte   { background: #E6F1FB; color: #185FA5; }

.badge-select {
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

/* ── RESTE À FACTURER ── */
.facturation-info { font-size: 11px; line-height: 1.6; }
.facturation-info .reste { color: var(--texte-sec); }
.facturation-info .deja  { color: #0F6E56; }

/* ── ACTIONS ROUE ── */
.row-actions { display: flex; align-items: center; gap: 4px; }

/* ── FORMULAIRE DEVIS ── */
.devis-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-section {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.form-section-header {
  background: var(--gris-clair);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--texte-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-section-body { padding: 16px; }

.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-row:last-child { margin-bottom: 0; }

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

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-sec);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group label .required { color: var(--rouge); }

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--texte);
  background: var(--blanc);
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--rouge);
  box-shadow: 0 0 0 3px rgba(150, 20, 20, 0.08);
}

.form-control::placeholder { color: #bbb; }

textarea.form-control { resize: vertical; min-height: 70px; line-height: 1.5; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.form-control-static {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--texte);
  background: var(--gris-clair);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.4;
}

/* Vendeur bloc */
.vendeur-info {
  font-size: 13px;
  line-height: 1.7;
  color: var(--texte);
}
.vendeur-info strong { font-weight: 600; }

/* Type particulier/pro */
.radio-group { display: flex; gap: 16px; margin-bottom: 12px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; cursor: pointer; color: var(--texte); }

/* ── TABLEAU LIGNES ── */
.lignes-section {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.lignes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--gris-clair);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--texte-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lignes-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 13px;
}

.lignes-table thead th {
  background: #fafafa;
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-sec);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.lignes-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.lignes-table tbody tr:last-child { border-bottom: none; }

.lignes-table tbody td {
  padding: 6px 8px;
  vertical-align: top;
}

.lignes-table .td-drag { width: 30px; color: var(--texte-sec); cursor: grab; text-align: center; }
.lignes-table .td-num-ligne { width: 30px; color: var(--texte-sec); text-align: center; font-size: 12px; padding-top: 14px; }
.lignes-table .td-nom { min-width: 200px; }
.lignes-table .td-desc { width: 100%; }
.lignes-table .td-reduc { width: 80px; }
.lignes-table .td-qte { width: 70px; }
.lignes-table .td-unite { width: 80px; }
.lignes-table .td-tva { width: 80px; }
.lignes-table .td-pu { width: 100px; }
.lignes-table .td-total-ht { width: 100px; }
.lignes-table .td-total-ttc { width: 100px; }
.lignes-table .td-del { width: 40px; text-align: center; }

.ligne-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  color: var(--texte);
  background: transparent;
  font-family: inherit;
  transition: all 0.15s;
}
.ligne-input:focus {
  outline: none;
  border-color: var(--rouge);
  background: var(--blanc);
  box-shadow: 0 0 0 2px rgba(150,20,20,0.06);
}
.ligne-input::placeholder { color: #ccc; }

.ligne-desc {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  color: var(--texte-sec);
  background: transparent;
  resize: none;
  min-height: 36px;
  font-family: inherit;
  line-height: 1.4;
}
.ligne-desc:focus {
  outline: none;
  border-color: var(--gris-bord);
  background: #fafafa;
}

.ligne-total { font-weight: 600; color: var(--texte); padding-top: 12px; display: block; }

.btn-del-ligne {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  font-size: 16px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-del-ligne:hover { color: #e74c3c; background: #fff0f0; }

.lignes-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── AUTOCOMPLÉTION ── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 300;
  max-height: 200px;
  overflow-y: auto;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.autocomplete-item:hover { background: var(--gris-clair); }
.autocomplete-item .ac-prix { color: var(--rouge); font-weight: 600; font-size: 12px; }

/* ── TOTAUX ── */
.totaux-section {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.totaux-box {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 340px;
}

.totaux-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.totaux-row:last-child { border-bottom: none; }
.totaux-row label { color: var(--texte-sec); }
.totaux-row .val { font-weight: 500; color: var(--texte); }

.totaux-row.total-final {
  background: var(--anthracite);
  border-top: 2px solid var(--rouge);
}
.totaux-row.total-final label { color: #fff; font-weight: 600; font-size: 14px; }
.totaux-row.total-final .val { color: #fff; font-size: 16px; font-weight: 700; }

/* ── OPTIONS BAS DE FORMULAIRE ── */
.options-section {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.options-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-sec);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.options-toggle:hover { background: var(--gris-clair); }

.options-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: none;
}
.options-body.open { display: block; }

/* ── IA ZONE ── */
.ia-zone {
  background: linear-gradient(135deg, #0F1820 0%, #1a2a3a 100%);
  border: 1px solid #2a3a4a;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.ia-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ia-badge {
  background: var(--rouge);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ia-title {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.ia-sub {
  color: #8aa0b8;
  font-size: 12px;
}

.ia-input-row {
  display: flex;
  gap: 8px;
}

.ia-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #2a3a4a;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.ia-input:focus {
  outline: none;
  border-color: var(--rouge);
  background: rgba(255,255,255,0.1);
}
.ia-input::placeholder { color: #4a6080; }

.ia-btn-send {
  background: var(--rouge);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.ia-btn-send:hover { background: var(--rouge-hover); }

.ia-response {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  border: 1px solid #2a3a4a;
  color: #c8d8e8;
  font-size: 13px;
  line-height: 1.6;
  display: none;
}
.ia-response.visible { display: block; }
.ia-loading { color: #8aa0b8; font-style: italic; }

/* ── CLIENTS ── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.client-card {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.client-card:hover { border-color: var(--rouge); box-shadow: 0 2px 8px rgba(150,20,20,0.08); }

.client-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--anthracite);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.client-name { font-size: 14px; font-weight: 600; color: var(--texte); }
.client-type { font-size: 11px; color: var(--texte-sec); }
.client-meta { font-size: 12px; color: var(--texte-sec); line-height: 1.6; }
.client-stats { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.client-stat-item { font-size: 11px; color: var(--texte-sec); }
.client-stat-item strong { display: block; font-size: 14px; color: var(--rouge); font-weight: 600; }

/* ── CATALOGUE ── */
.catalogue-list {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { background: #fafafa; }

.cat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--rouge-light);
  color: var(--rouge);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 13px; font-weight: 600; color: var(--texte); }
.cat-desc { font-size: 12px; color: var(--texte-sec); margin-top: 1px; }
.cat-prix { font-size: 14px; font-weight: 700; color: var(--rouge); white-space: nowrap; }
.cat-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.cat-item:hover .cat-actions { opacity: 1; }

/* ── RÉGLAGES ── */
.settings-sections { display: flex; flex-direction: column; gap: 16px; }

.settings-card {
  background: var(--blanc);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.settings-card-header {
  padding: 12px 18px;
  background: var(--gris-clair);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-card-header i { color: var(--rouge); font-size: 16px; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.settings-row:last-child { border-bottom: none; }

.settings-label { font-size: 13px; font-weight: 500; color: var(--texte); }
.settings-sub { font-size: 11px; color: var(--texte-sec); margin-top: 2px; }

.settings-control { min-width: 200px; }
.settings-control .form-control { margin: 0; }

/* ── APERÇU PDF ── */
.pdf-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.pdf-preview-modal.open { display: flex; }

.pdf-preview-inner {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pdf-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--blanc);
  z-index: 10;
}

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-input-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texte-sec);
  font-size: 15px;
}
.search-input {
  width: 100%;
  padding: 8px 10px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--blanc);
  color: var(--texte);
}
.search-input:focus { outline: none; border-color: var(--rouge); }

/* ── SAUVEGARDE BAR ── */
.save-bar {
  background: var(--blanc);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  z-index: 50;
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--anthracite);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideIn 0.2s ease;
}
.toast.success { border-left: 3px solid #0F6E56; }
.toast.error   { border-left: 3px solid var(--rouge); }
.toast.info    { border-left: 3px solid #185FA5; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--texte-sec);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; color: var(--gris-bord); display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--texte); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; margin-bottom: 16px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar { 
    width: 100%; min-width: 100%; height: auto; position: relative; top: auto;
    display: flex; flex-direction: row; overflow-x: auto; padding: 10px 16px; gap: 8px; align-items: center;
    border-bottom: 1px solid #2a3a4a;
  }
  .sidebar-logo { padding: 0; border: none; margin-right: 16px; }
  .nav-section { display: none; }
  .nav-item { margin: 0; white-space: nowrap; padding: 8px 12px; }
  .sidebar-bottom { display: none; }

  .main-content { width: 100%; }
  .devis-form { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .search-input-wrap { flex: 1; max-width: none; }
}

@media (max-width: 600px) {
  .page-content { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .data-table thead { display: none; }
  .data-table tbody td { display: block; padding: 6px 14px; text-align: left; }
  .data-table tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .td-num { display: inline-block; }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
  .ia-input-row { flex-direction: column; }
  .ia-btn-send { width: 100%; justify-content: center; }
  .totaux-box { min-width: 100%; }
  .table-footer { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ── UTILITAIRES ── */
.text-rouge  { color: var(--rouge); }
.text-vert   { color: #0F6E56; }
.text-sec    { color: var(--texte-sec); }
.fw-600      { font-weight: 600; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.ml-auto     { margin-left: auto; }
.full-width  { width: 100%; }
.hidden      { display: none !important; }
