:root {
  --color-primary: #E6C86E;
  --color-primary-hover: #D9BA5F;

  --color-bg: #F5F6F8;
  --color-surface: #FFFFFF;

  --color-text: #2B2B2B;
  --color-text-muted: #6B6B6B;

  --color-border: #E2E3E5;

  --color-success: #6FAF8F;
  --color-danger: #D97A7A;

  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

  --font-base: "Segoe UI", Tahoma, Arial, sans-serif;
}

/* ================= GLOBAL ================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================= HEADER GLOBAL ================= */

.app-header {
  min-height: 72px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: var(--shadow-sm);

  position: sticky;
  top: 0;
  z-index: 900;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-logo {
  height: 44px;
  width: auto;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ================= LAYOUT ================= */

.page-shell {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 24px;
}

.page-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.page-header h1 {
  margin: 0 0 6px;
}

.page-subtitle {
  margin: 0;
  color: var(--color-text-muted);
}

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

/* ================= CARTES HUB / MODULES ================= */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.hub-card {
  height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: 0.15s;
}

.hub-card:hover {
  background: #FFF8E0;
  border-color: var(--color-primary);
}

.hub-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.hub-card-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

/* ================= CARTES CONTENU ================= */

.page-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.page-card h2 {
  margin: 0 0 18px;
}

/* ================= ACCUEIL ================= */

.home-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.home-mini-card {
  background: #FFF9E6;
  border: 1px solid #F0E1B2;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.home-mini-card.messages {
  background: #F8F9FB;
  border: 1px solid var(--color-border);
}

.home-mini-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.home-mini-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ================= TABLEAUX ================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: #FAFAFA;
  font-size: 0.85rem;
  text-align: left;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.table-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 18px;
}

/* ================= CHECKBOX DROITS ================= */

.permissions-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.permissions-table th:not(:first-child),
.permissions-table td:not(:first-child) {
  text-align: center;
}

/* ================= BOUTONS ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: #fff;
  border-color: var(--color-border);
}

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

/* ================= FORMULAIRES ================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-field label,
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ================= INFOS / RIB / ESPACE ================= */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.info-item {
  background: #FAFAFA;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 13px;
}

.info-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* ================= ACTIONS BAS ================= */

.bottom-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ================= BADGES ================= */

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge-success {
  background: #EDF7F1;
}

.badge-muted {
  background: #EEF0F3;
}

/* ================= ALERTES ================= */

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.alert-success {
  background: #EDF7F1;
  color: #2F6F45;
  border: 1px solid #B9DFC8;
}

.alert-error {
  background: #FBEAEA;
  color: #8B2F2F;
  border: 1px solid #F0CACA;
}

/* ================= LOGIN ================= */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-logo {
  height: 78px;
  width: auto;
  display: block;
  margin: 0 auto 18px;
}

.login-card h1 {
  margin: 0 0 22px;
  font-size: 1.9rem;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--color-text-muted);
}

.login-card form {
  margin-top: 10px;
  text-align: left;
}

.login-card .form-group {
  margin-bottom: 18px;
}

.login-card label {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.login-card input {
  margin-top: 4px;
  background: #fff;
}

.login-card .btn {
  margin-top: 10px;
  width: 100%;
}

/* ================= FOOTER ================= */

.app-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 24px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 760px) {
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .hub-card {
    height: auto;
    min-height: 100px;
  }
}

/* ================= UTILITAIRES ================= */

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

.btn {
  transition: 0.15s;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-empty {
  font-style: italic;
}

.signature-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: #FAFAFA;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.signature-preview img {
  max-width: 300px;
  max-height: 140px;
  height: auto;
  width: auto;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
  color: var(--color-text-muted);
}

.checkbox-line input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.error-card {
  max-width: 620px;
  margin: 40px auto;
  text-align: center;
}

.error-message {
  color: var(--color-text-muted);
  margin: 18px 0 26px;
}

.error-actions {
  justify-content: center;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  table-layout: fixed;
}

.data-table td,
.data-table th {
  vertical-align: top;
}

.cell-details {
  max-width: 520px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ================= TABLE WRAPPER / LOGS ================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  table-layout: fixed;
}

.data-table td,
.data-table th {
  vertical-align: top;
}

.cell-details {
  max-width: 520px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.logs-table .col-date {
  width: 170px;
}

.logs-table .col-user {
  width: 160px;
}

.logs-table .col-action {
  width: 180px;
}

.logs-table .col-target {
  width: 120px;
}

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checkbox-line input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.signature-preview img {
  max-width: 320px;
  max-height: 140px;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.data-table td {
  vertical-align: middle;
}

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

.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* TABLE ADMIN MODULES */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  vertical-align: middle; /* 🔥 clé pour alignement vertical */
}

/* ALIGNEMENTS PAR COLONNE */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 120px; /* Code */
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 200px; /* Nom */
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: auto; /* Description flexible */
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
  width: 80px;
  text-align: center;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
  width: 120px;
  text-align: center;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
  width: 160px;
  text-align: center;
}

/* BADGE CENTRÉ */
.badge {
  display: inline-block;
}

/* ACTIONS */
.table-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* TABLE HISTORIQUE SIGNATURE */
.signature-table {
  table-layout: fixed;
  width: 100%;
}

.signature-table th,
.signature-table td {
  vertical-align: middle;
  padding: 12px 14px;
}

/* COLONNES */
.signature-table th:nth-child(1),
.signature-table td:nth-child(1) {
  width: 160px; /* Date */
}

.signature-table th:nth-child(2),
.signature-table td:nth-child(2) {
  width: 140px; /* Signature */
  text-align: center;
}

.signature-table th:nth-child(3),
.signature-table td:nth-child(3) {
  width: 120px; /* Statut */
  text-align: center;
}

.signature-table th:nth-child(4),
.signature-table td:nth-child(4) {
  width: 140px; /* Actions */
  text-align: center;
}

/* BOUTONS COMPACTS */
.signature-table .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* DATE SUR 2 LIGNES PROPRE */
.signature-table td:first-child {
  line-height: 1.3;
}

/* ================= TABLE SIGNATURE ================= */

.signature-table {
  table-layout: fixed;
  width: 100%;
}

.signature-table th,
.signature-table td {
  vertical-align: middle;
  padding: 12px 14px;
}

.signature-table th:nth-child(1),
.signature-table td:nth-child(1) {
  width: 150px;
}

.signature-table th:nth-child(2),
.signature-table td:nth-child(2) {
  width: 130px;
  text-align: center;
}

.signature-table th:nth-child(3),
.signature-table td:nth-child(3) {
  width: 110px;
  text-align: center;
}

.signature-table th:nth-child(4),
.signature-table td:nth-child(4) {
  width: 130px;
  text-align: center;
}

.signature-table .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ================= TABLE USERS CLEAN ================= */

.users-table {
  width: 100%;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  padding: 16px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.users-table th {
  font-weight: 700;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 260px;
  text-align: left;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2),
.users-table th:nth-child(3),
.users-table td:nth-child(3),
.users-table th:nth-child(4),
.users-table td:nth-child(4),
.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 130px;
  text-align: center;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 160px;
  text-align: right;
}

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

.user-cell strong {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell .text-muted {
  font-size: 0.9rem;
}

.btn-table {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* ================= TABLE VEHICULES HISTORIQUE ================= */

.vehicles-history-table {
  table-layout: fixed;
  width: 100%;
}

.vehicles-history-table th,
.vehicles-history-table td {
  vertical-align: middle;
  padding: 12px 14px;
}

.vehicles-history-table th:nth-child(1),
.vehicles-history-table td:nth-child(1) {
  width: 150px;
}

.vehicles-history-table th:nth-child(2),
.vehicles-history-table td:nth-child(2) {
  width: 180px;
}

.vehicles-history-table th:nth-child(3),
.vehicles-history-table td:nth-child(3) {
  width: 140px;
}

.vehicles-history-table th:nth-child(4),
.vehicles-history-table td:nth-child(4) {
  width: 110px;
  text-align: center;
}

.vehicles-history-table th:nth-child(5),
.vehicles-history-table td:nth-child(5) {
  width: 150px;
  text-align: center;
}

.vehicles-history-table .table-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.vehicles-history-table .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ================= PASSWORD FIELD ================= */

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 42px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

/* ACTIONS USERS */
.table-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;              /* espace entre boutons */
  flex-wrap: nowrap;
}

/* BOUTONS PLUS PROPRES */
.table-actions .btn {
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 8px;
  line-height: 1;
  min-width: 70px;       /* largeur homogène */
}

/* HIÉRARCHIE VISUELLE */
.btn-secondary {
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #333;
}

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

/* bouton droits (highlight) */
.btn-primary {
  background: #d6b25e;
  border: none;
  color: #000;
}

.btn-primary:hover {
  background: #c8a44d;
}

/* bouton danger soft */
.btn-danger-soft {
  background: #f8f8f8;
  border: 1px solid #ddd;
  color: #555;
}

.btn-danger-soft:hover {
  background: #f0f0f0;
}

/* Table sans scroll horizontal */
.table-wrapper {
  overflow-x: hidden;
}

/* Forcer une ligne compacte */
.data-table td,
.data-table th {
  white-space: nowrap;
  vertical-align: middle;
}

/* Colonne actions compacte */
.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Boutons plus petits dans table */
.table-actions .btn {
  padding: 6px 10px;
  font-size: 13px;
  min-height: auto;
}

/* Réduction largeur colonnes inutiles */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 120px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2),
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 120px;
}

/* Date un peu plus large */
.data-table th:nth-child(4),
.data-table td:nth-child(4) {
  width: 180px;
}

.header-exercice {
  display: flex;
  align-items: center;
}

.header-exercice select {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.header-exercice {
  display: flex;
  align-items: center;
}

.header-exercice select {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  margin-right: 10px;
}

.axes-table {
  width: 100%;
  table-layout: fixed;
}

.axes-table th,
.axes-table td {
  vertical-align: middle;
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: break-word;
}

.axes-table .col-pole {
  width: 22%;
}

.axes-table .col-responsable {
  width: 22%;
}

.axes-table .col-axe {
  width: 32%;
}

.axes-table .col-actif {
  width: 10%;
  text-align: center;
}

.axes-table .col-actions {
  width: 14%;
  text-align: right;
  white-space: nowrap;
}

.axes-table {
  width: 100%;
  table-layout: fixed;
}

.axes-table th,
.axes-table td {
  vertical-align: middle;
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: break-word;
}

.axes-table .col-pole {
  width: 24%;
}

.axes-table .col-responsable {
  width: 24%;
}

.axes-table .col-axe {
  width: 30%;
}

.axes-table .col-actif {
  width: 9%;
  text-align: center;
}

.axes-table .col-actions {
  width: 13%;
  text-align: right;
  white-space: nowrap;
}

.groupes-table {
  width: 100%;
  table-layout: fixed;
}

.groupes-table th,
.groupes-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.groupes-table .col-nom {
  width: 35%;
}

.groupes-table .col-responsable {
  width: 35%;
}

.groupes-table .col-actif {
  width: 10%;
  text-align: center;
}

.groupes-table .col-actions {
  width: 20%;
  text-align: right;
}

.axes-table {
  width: 100%;
  table-layout: fixed;
}

.axes-table th,
.axes-table td {
  padding: 14px 16px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.axes-table .col-pole {
  width: 22%;
}

.axes-table .col-responsable {
  width: 22%;
}

.axes-table .col-axe {
  width: 34%;
}

.axes-table .col-actif {
  width: 8%;
  text-align: center;
}

.axes-table .col-actions {
  width: 14%;
  text-align: right;
}

/* ================= TABLE CODES ANALYTIQUES ================= */

.codes-table {
  width: 100%;
  table-layout: fixed;
}

.codes-table th,
.codes-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* 🔥 ellipsis uniquement sur colonnes longues */
.codes-table .col-libelle,
.codes-table .col-groupe,
.codes-table .col-axe {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* LARGEURS */
.codes-table .col-code {
  width: 14%;
  font-weight: 700;
}

.codes-table .col-libelle {
  width: 22%;
}

.codes-table .col-groupe {
  width: 18%;
}

.codes-table .col-axe {
  width: 26%;
}

.codes-table .col-type {
  width: 10%;
  text-align: center;
}

.codes-table .col-actif {
  width: 10%;
  text-align: center;
}

.section-title {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #4b5563;
}

.hub-card--highlight {
  background: #eef4ff;
  border-color: #d6e4ff;
}

.hub-card--highlight .hub-card-title {
  color: #2f5bff;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.checkbox-row:hover {
  background: #eef2ff;
}

.checkbox-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-row small {
  color: #6b7280;
  font-size: 12px;
}

.users-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.user-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.user-select-card:hover {
  background: #eef4ff;
  border-color: #d6e4ff;
}

.user-select-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
}

.user-select-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-select-content strong {
  font-size: 14px;
  font-weight: 700;
}

.user-select-content small {
  font-size: 12px;
  color: #6b7280;
}

.users-search {
  width: 100%;
  margin-bottom: 8px;
}

.users-picker-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.users-picker-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.users-picker {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}

.user-select-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.user-select-card:hover {
  background: #eef4ff;
}

.user-select-card input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}

.user-select-content strong {
  font-size: 14px;
  font-weight: 600;
}

/* ===== MESSAGES ACCUEIL ===== */

.home-messages-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.home-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-left: 4px solid #d1d5db;
  font-size: 0.9rem;
}

.home-message strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.home-message p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Couleurs par priorité */
.home-message.urgent {
  border-left-color: #ef4444;
  background: #fff5f5;
}

.home-message.important {
  border-left-color: #f59e0b;
  background: #fffaf0;
}

.home-message.info {
  border-left-color: #3b82f6;
  background: #f5f9ff;
}

/* ===== MODAL ===== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  width: 420px;
  max-width: 90%;
  box-shadow: var(--shadow-md);
}

.modal-content h3 {
  margin-top: 0;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* colonne actions */
.data-table td.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* boutons plus compacts */
.data-table td.table-actions .btn {
  padding: 4px 8px;
  font-size: 12px;
  min-height: auto;
  white-space: nowrap;
}

/* ================= TABLE MESSAGES ADMIN - CLEAN ================= */

.messages-table {
  width: 100%;
  table-layout: fixed;
}

.messages-table .col-title {
  width: 24%;
}

.messages-table .col-cible {
  width: 14%;
}

.messages-table .col-priorite {
  width: 13%;
}

.messages-table .col-date {
  width: 13%;
}

.messages-table .col-actif {
  width: 9%;
}

.messages-table .col-actions {
  width: 14%;
}

.messages-table th,
.messages-table td {
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-table th:nth-last-child(-n+3),
.messages-table td:nth-last-child(-n+3) {
  text-align: center;
}

.message-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.message-actions .btn {
  min-width: 64px;
  padding: 6px 8px;
  font-size: 12px;
  min-height: 30px;
}

/* ================= HEADER ANOMALIE ================= */

.app-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-anomalie {
  border-color: var(--color-primary);
  font-weight: 600;
}

/* ================= ANOMALIES ================= */

.form-field-full {
  grid-column: 1 / -1;
}

.badge-warning {
  background: #fff7e6;
  color: #9a6700;
  border: 1px solid #f2d28b;
}

.badge-danger {
  background: #fff1f1;
  color: #b42318;
  border: 1px solid #f1b4b4;
}

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

.small {
  font-size: 0.82rem;
}

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

textarea {
  resize: vertical;
}

/* ================= ANOMALIES - LISTE PROPRE ================= */

.anomalies-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.anomalie-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.anomalie-main {
  flex: 1;
  min-width: 0;
}

.anomalie-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.anomalie-title-row h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.anomalie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: #4b5563;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.anomalie-route {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.85rem;
}

.anomalie-description {
  margin: 8px 0 12px;
  color: #111827;
  line-height: 1.45;
}

.anomalie-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: #6b7280;
  font-size: 0.9rem;
}

.anomalie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .anomalie-card {
    flex-direction: column;
  }

  .anomalie-actions {
    justify-content: flex-start;
  }
}

.btn-success-soft {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.btn-success-soft:hover {
  background: #dcedc8;
  color: #1b5e20;
}

.form-top-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.password-toggle:hover {
  opacity: 0.75;
}

.btn-success-soft {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.btn-success-soft:hover {
  background: #dcedc8;
  color: #1b5e20;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 420px;
  max-width: 90%;
}

.data-table td span {
  cursor: help;
}

.form-field-full {
  grid-column: 1 / -1;
}

.usage-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.usage-card {
  min-width: 135px;
  padding: 12px 14px;
  border: 1px solid #d8dbe0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.usage-card input {
  display: none;
}

.usage-card-title {
  font-weight: 800;
}

.usage-card-state {
  font-size: 13px;
  color: #6b7280;
}

.usage-card.is-active {
  border-color: #e6c86e;
  background: #fff8df;
}

.usage-card.is-active .usage-card-state {
  color: #8a6d00;
  font-weight: 700;
}
.article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.article-label {
  flex: 1;
}

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

.header-row {
  font-weight: 700;
  color: #555;
}


/* DEVIS - sélection client recherchable */
.client-picker {
  width: 100%;
}

.client-picker-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.client-picker-search {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.client-create-btn {
  white-space: nowrap;
  min-height: 38px;
}

.client-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 6px;
}

.client-option {
  width: 100%;
  border: 0;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.client-option:hover,
.client-option:focus {
  background: #fff8df;
  outline: none;
}

.client-option span,
.client-preview-meta,
.client-preview-label {
  color: #6b7280;
  font-size: 13px;
}

.client-dropdown-empty {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #6b7280;
}

.client-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8dbe0;
  border-radius: 14px;
  background: #f9fafb;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-preview > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-preview-meta {
  text-align: right;
}

@media (max-width: 720px) {
  .client-picker-row {
    flex-direction: column;
  }

  .client-picker-search,
  .client-create-btn {
    width: 100%;
  }

  .client-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-preview-meta {
    text-align: left;
  }
}

/* ================= DEVIS - LISTE PROPRE ================= */
.devis-search-card {
  margin-bottom: 18px;
}

.devis-search-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.devis-search-field {
  flex: 1;
  min-width: 260px;
}

.devis-counter-box {
  min-width: 130px;
  padding: 10px 14px;
  border: 1px solid #d8dbe0;
  border-radius: 14px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.devis-counter-box span {
  font-size: 12px;
  color: #6b7280;
}

.devis-list-card {
  overflow: hidden;
}

.devis-list-table {
  width: 100%;
  table-layout: fixed;
}

.devis-list-table th,
.devis-list-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.devis-list-table th:nth-child(1),
.devis-list-table td:nth-child(1) {
  width: 110px;
}

.devis-list-table th:nth-child(2),
.devis-list-table td:nth-child(2) {
  width: auto;
}

.devis-list-table th:nth-child(3),
.devis-list-table td:nth-child(3) {
  width: 120px;
  text-align: center;
}

.devis-list-table th:nth-child(4),
.devis-list-table td:nth-child(4) {
  width: 125px;
  text-align: center;
}

.devis-list-table th:nth-child(5),
.devis-list-table td:nth-child(5) {
  width: 130px;
  text-align: right;
}

.devis-list-table th:nth-child(6),
.devis-list-table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

.devis-list-table th:nth-child(7),
.devis-list-table td:nth-child(7) {
  width: 170px;
  text-align: right;
}

.devis-client-cell {
  min-width: 0;
}

.devis-client-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.devis-numero strong,
.devis-total strong {
  font-size: 16px;
}

.devis-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.btn-compact {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1;
}

.devis-pdf-cell .badge,
.devis-statut .badge {
  max-width: 100%;
}

@media (max-width: 900px) {
  .devis-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .devis-counter-box {
    width: 100%;
  }

  .devis-list-card {
    overflow-x: auto;
  }

  .devis-list-table {
    min-width: 760px;
  }
}


/* ================= DEVIS - DETAIL PROPRE ================= */
.devis-detail-card {
  margin-bottom: 18px;
}

.devis-detail-grid {
  display: grid;
  grid-template-columns: 140px minmax(260px, 1fr) 140px minmax(180px, 260px) 130px;
  gap: 14px;
  align-items: stretch;
}

.devis-info-box {
  border: 1px solid #e1e4e8;
  border-radius: 16px;
  background: #fbfcfd;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.devis-info-box label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.devis-info-box strong,
.devis-info-box span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.devis-client-box strong {
  white-space: normal;
  line-height: 1.25;
}

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

.card-title-row h3 {
  margin: 0;
}

.devis-total-pill {
  border: 1px solid #e3c05b;
  background: #fff8df;
  border-radius: 999px;
  padding: 9px 14px;
  white-space: nowrap;
}

.devis-pdf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.devis-pdf-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e1e4e8;
  background: #fbfcfd;
  border-radius: 16px;
  padding: 14px 16px;
}

.devis-pdf-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.devis-pdf-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devis-pdf-main span,
.devis-pdf-history summary {
  color: #6b7280;
  font-size: 13px;
}

.devis-pdf-history {
  margin-top: 2px;
}

.devis-pdf-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.devis-status-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

@media (max-width: 980px) {
  .devis-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .devis-client-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .card-title-row,
  .devis-pdf-line,
  .devis-status-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .devis-detail-grid {
    grid-template-columns: 1fr;
  }

  .devis-total-pill {
    white-space: normal;
  }
}

/* === DEVIS : détail + statut compact === */
.devis-status-card {
  max-width: 900px;
}

.devis-status-title-row {
  margin-bottom: 14px;
}

.devis-status-form-compact {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 14px;
  align-items: center;
  justify-content: start;
}

.devis-status-form-compact select {
  width: 100%;
}

.devis-status-help {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.devis-pdf-card .card-title-row {
  align-items: center;
}

.devis-pdf-line {
  max-width: 780px;
}

@media (max-width: 700px) {
  .devis-status-card {
    max-width: none;
  }

  .devis-status-form-compact {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}


/* ================= DEVIS - FORM NOUVEAU ALIGNÉ STANDARD =================
   Correctif ciblé : le détail était déjà OK ; on aligne uniquement le formulaire
   Nouveau devis sur la largeur standard page-shell / page-card EurekaPilot.
*/
.devis-clean-form,
.devis-clean-form .page-card,
.devis-clean-card,
.devis-lines-card,
.devis-total-card-clean,
.devis-clean-actions {
  width: 100%;
  max-width: none;
}

.devis-clean-card,
.devis-detail-section {
  margin-left: 0;
  margin-right: 0;
}

.devis-clean-actions {
  margin-left: 0;
  margin-right: 0;
}

.devis-main-card,
.devis-lines-card,
.devis-total-card-clean {
  padding: 24px 26px;
}

.devis-clean-head,
.devis-clean-section-head {
  align-items: flex-start;
}

.devis-clean-client-row,
.devis-clean-infos-row,
.devis-clean-axe-row {
  max-width: 100%;
}

.devis-axe-global-field {
  max-width: 640px;
}

.devis-line-entry {
  width: 100%;
}

.devis-clean-lines-table .col-designation { width: auto; }
.devis-clean-lines-table .col-qte { width: 80px; }
.devis-clean-lines-table .col-prix { width: 130px; }
.devis-clean-lines-table .col-remise { width: 130px; }
.devis-clean-lines-table .col-total { width: 140px; }
.devis-clean-lines-table .col-action { width: 70px; }

@media (max-width: 800px) {
  .devis-main-card,
  .devis-lines-card,
  .devis-total-card-clean {
    padding: 20px;
  }
}

/* ================= DEVIS FORM FULL WIDTH ================= */

.page-shell {
  max-width: 1400px; /* ⬅️ élargit globalement */
}

.page-card {
  width: 100%;
}

/* spécifique devis (optionnel mais propre) */
.devis-form .page-card {
  max-width: 100%;
}

/* ===== DEVIS - FORM SIMPLIFIÉ ===== */

.devis-line-entry {
  padding: 14px;
}

.devis-line-entry-bottom {
  display: grid;
  grid-template-columns: 80px 120px 140px auto;
  gap: 10px;
  align-items: end;
}

.devis-line-entry-bottom input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 14px;
}

/* remise compacte */
#remise {
  text-align: right;
}

/* bouton compact */
.devis-add-btn-wrap .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
}

/* textarea plus propre */
.devis-designation-field textarea {
  min-height: 55px;
  font-size: 14px;
}

.picker-dropdown {
  display: none;
}

.picker-dropdown.is-visible {
  display: block;
}

/* ================= DEVIS - LISTES FLOTTANTES PROPRES ================= */

.client-picker-search,
.article-picker-search,
.axe-picker-search {
  position: relative;
}

.picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;

  display: none;
  max-height: 260px;
  overflow-y: auto;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.14);
  padding: 6px;
}

.picker-dropdown.is-visible {
  display: block;
}

.picker-option {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.picker-option:hover {
  background: #fff8df;
}

.picker-option strong {
  display: block;
  font-size: 14px;
}

.picker-option span {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ===== DEVIS HEADER COMPACT ===== */

.devis-header-compact {
  padding: 14px 18px;
}

.devis-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: center;
}

.devis-header-grid .label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.devis-header-grid strong {
  font-size: 14px;
}

.devis-header-grid strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== DEVIS STATUT COMPACT ===== */

.devis-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.input-status {
  width: 220px; /* ⬅️ réduit la largeur */
}

/* bouton aligné propre */
.devis-status-row .btn {
  height: 36px;
  padding: 0 14px;
}

/* ================= DEVIS - TOTAUX PROPRES ================= */

.devis-total-card {
  display: flex;
  justify-content: flex-end;
}

.devis-total-box {
  width: 100%;
  max-width: 560px;
  background: #fffdf5;
  border: 1px solid #efd78a;
  border-radius: 16px;
  padding: 18px;
}

.devis-total-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
  color: var(--color-text);
}

.devis-total-line span {
  color: var(--color-text-muted);
}

.devis-total-line strong {
  font-size: 1rem;
}

.devis-remise-controls {
  display: grid;
  grid-template-columns: 120px 120px;
  gap: 8px;
}

.devis-remise-controls select,
.devis-remise-controls input {
  min-height: 36px;
}

.devis-total-final {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--color-primary);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.devis-total-final strong {
  font-size: 1.25rem;
}

@media (max-width: 760px) {
  .devis-total-card {
    justify-content: stretch;
  }

  .devis-total-box {
    max-width: none;
  }

  .devis-remise-controls {
    grid-template-columns: 1fr;
  }
}
/* ===== FIX DROPDOWN DEVIS ===== */

.page-card,
.devis-list-card,
.devis-lines-card,
.devis-main-card {
  overflow: visible !important;
}

.picker-dropdown {
  z-index: 9999;
}

/* ================= ADMIN ANALYTIQUE - ACTIONS LISTES ================= */

.groupes-table .table-actions,
.axes-table .table-actions,
.codes-table .table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.groupes-table .table-actions .btn,
.axes-table .table-actions .btn,
.codes-table .table-actions .btn {
  min-width: 110px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
}

.groupes-table .col-actions,
.axes-table .col-actions,
.codes-table .col-actions {
  text-align: right;
}

/* Harmonisation des listes ADMIN */
.page-card {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  width: 160px;
  text-align: right;
  white-space: nowrap;
}

.data-table .btn,
.data-table button.btn,
.data-table a.btn {
  min-width: 86px;
  height: 36px;
  padding: 7px 14px;
  font-size: 0.92rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.table-actions form {
  margin: 0;
}

.table-actions .btn {
  min-width: 92px;
}

.home-action-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.home-action-link:hover {
  background: #f2f4f7;
}

.modal-content {
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f2f4f7;
  cursor: pointer;
  font-size: 1rem;
}

.modal-close:hover {
  background: #e4e7eb;
}

.page-card .data-table {
  width: 100%;
}

.page-card .data-table table {
  width: 100%;
}

.page-card .data-table th,
.page-card .data-table td {
  width: auto;
}

.td-description {
  width: 420px;
  max-width: 420px;
  min-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-porteur {
  width: 180px;
  padding-left: 6px !important;
}

.badge-warning {
  background: #FFF3CD;
  color: #856404;
}

.badge-info {
  background: #DDEEFF;
  color: #1F4E79;
}

/* ================= LOGIN MOBILE IPHONE ================= */

@media (max-width: 760px) {
  .login-body {
    align-items: flex-start;
    padding: 18px;
    min-height: 100dvh;
  }

.login-card {
  width: 100%;
  max-width: 100%;    margin-top: 22px;
    padding: 28px 22px;
    border-radius: 18px;
  }

.login-body {
  width: 100%;
}

  .login-logo {
    height: 64px;
    margin-bottom: 14px;
  }

  .login-card h1 {
    font-size: 1.55rem;
    margin-bottom: 18px;
  }

  .login-card p {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .login-card input,
  .login-card select,
  .login-card textarea {
    font-size: 16px;
    min-height: 46px;
  }

  .login-card .btn {
    min-height: 46px;
    font-size: 16px;
  }

  .login-card label {
    font-size: 0.95rem;
  }

  .checkbox-line {
    align-items: center;
    margin: 10px 0 14px;
  }

  .checkbox-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.mobile-actions .btn {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.mobile-actions .btn {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

@media (max-width: 760px) {
  .login-card input,
  .login-card select,
  .login-card textarea {
    font-size: 16px;
    min-height: 48px;
  }
}
.login-card input[type="date"] {
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}


/* ================= MOBILE EUREKAPILOT ================= */

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.mobile-actions .btn {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.login-card input[type="date"] {
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

@media (max-width: 760px) {
  .login-body {
    align-items: flex-start;
    padding: 18px;
    min-height: 100dvh;
    width: 100%;
  }

  .login-card {
    width: 100%;
    max-width: 100%;
    margin-top: 22px;
    padding: 28px 22px;
    border-radius: 18px;
  }

  .login-logo {
    height: 64px;
    margin-bottom: 14px;
  }

  .login-card h1 {
    font-size: 1.55rem;
    margin-bottom: 18px;
  }

  .login-card p {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .login-card input,
  .login-card select,
  .login-card textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .login-card .btn {
    min-height: 52px;
    font-size: 16px;
  }

  .login-card label {
    font-size: 0.95rem;
  }

  .checkbox-line {
    align-items: center;
    margin: 10px 0 14px;
  }

  .checkbox-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}

.mobile-photo-guide {
  margin: 18px 0;
  text-align: center;
}

.mobile-photo-frame {
  height: 260px;
  border: 3px dashed #E6C86E;
  border-radius: 18px;
  background: #fffdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a6d00;
  font-weight: 700;
  font-size: 18px;
}

.mobile-photo-guide p {
  color: #6b7280;
  font-size: 14px;
  margin-top: 10px;
}

.mobile-help {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.mobile-help {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.mobile-preview {
  margin-top: 18px;
  text-align: center;
}

.mobile-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 16px;
  border: 1px solid #d1d5db;
  transition: transform 0.2s ease;
  background: white;
}

.mobile-preview .btn {
  margin-top: 12px;
}

.hidden {
  display: none;
}

/* ================= LOADING OVERLAY ================= */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 246, 248, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-box {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  max-width: 320px;
}

.loading-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  border: 5px solid #eee;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-box strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.loading-box p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

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

.mobile-file-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 48px;

  text-align: center;
  cursor: pointer;
}

/* ================= FRAIS - AVANCES ================= */

.frais-avances-table {
  table-layout: fixed;
  width: 100%;
}

.frais-avances-table th:nth-child(1),
.frais-avances-table td:nth-child(1) {
  width: 130px;
}

.frais-avances-table th:nth-child(2),
.frais-avances-table td:nth-child(2) {
  width: auto;
}

.frais-avances-table th:nth-child(3),
.frais-avances-table td:nth-child(3) {
  width: 130px;
  text-align: right;
}

.frais-avances-table th:nth-child(4),
.frais-avances-table td:nth-child(4) {
  width: 130px;
  text-align: center;
}

.frais-avances-table th:nth-child(5),
.frais-avances-table td:nth-child(5) {
  width: 360px;
  text-align: right;
}

.td-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= FRAIS - GESTION AVANCES ================= */

.frais-gestion-avances-table {
  table-layout: fixed;
  width: 100%;
}

.frais-gestion-avances-table th:nth-child(1),
.frais-gestion-avances-table td:nth-child(1) {
  width: 220px;
  padding-right: 28px;
}

.frais-gestion-avances-table th:nth-child(2),
.frais-gestion-avances-table td:nth-child(2) {
  width: 130px;
  padding-left: 18px;
}

.frais-gestion-avances-table th:nth-child(3),
.frais-gestion-avances-table td:nth-child(3) {
  width: auto;
}

.frais-gestion-avances-table th:nth-child(4),
.frais-gestion-avances-table td:nth-child(4) {
  width: 130px;
  text-align: right;
}

.frais-gestion-avances-table th:nth-child(5),
.frais-gestion-avances-table td:nth-child(5) {
  width: 130px;
  text-align: center;
}

.frais-gestion-avances-table th:nth-child(6),
.frais-gestion-avances-table td:nth-child(6) {
  width: 190px;
  text-align: right;
}

.frais-gestion-avances-table .td-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truncate{
  display:inline-block;
  max-width:140px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align:middle;
}

.section-gap {
  margin-bottom: 22px;
}

/* Badges suivi EPP - à ajouter dans public/css/app.css */
.epp-status {
  font-weight: 700;
}

.epp-status-conforme {
  background: #E7F7EE;
  color: #1F7A43;
}

.epp-status-surveiller {
  background: #FFF4D8;
  color: #8A5A00;
}

.epp-status-retard {
  background: #FDECEC;
  color: #B42318;
}

.epp-status-bilan8 {
  background: #EAF2FF;
  color: #1D4ED8;
}

.epp-status-aucun {
  background: #ECEFF3;
  color: #475467;
}

/* À coller dans public/css/app.css */
.epp-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.epp-status-conforme { background: #36C275; }
.epp-status-surveiller { background: #E6B73B; }
.epp-status-retard { background: #D83A56; }
.epp-status-bilan8 { background: #3E7BD6; }
.epp-status-aucun { background: #4B4453; }

.epp-check-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 12px 0 18px;
}

.epp-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #E2E3E5;
  border-radius: 10px;
  background: #fff;
}

.epp-check-row input[type="checkbox"],
.epp-check-row input[type="radio"] {
  width: 16px;
  height: 16px;
  justify-self: center;
  margin: 0;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-help {
  color: #6B6B6B;
  font-size: .92rem;
  line-height: 1.45;
  margin-top: 12px;
}

/* ===== EPP - correctifs légers ===== */
.epp-status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  white-space: nowrap;
}

.epp-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 11px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.epp-dot-conforme { background: #36C275; }
.epp-dot-surveiller { background: #E6B73B; }
.epp-dot-retard { background: #D83A56; }
.epp-dot-bilan8 { background: #3E7BD6; }
.epp-dot-aucun { background: #6B7280; }

.epp-check-list {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 12px 0 18px;
}

.epp-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-weight: 600;
}

.epp-check-row input[type="checkbox"],
.epp-check-row input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

.epp-non-concerne {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FDECEC;
  color: #B42318;
  border: 1px solid #F5B5B5;
  font-weight: 700;
  font-size: .9rem;
}

/* ================= EPP - CASES & STATUTS =================
   À coller à la fin de public/css/app.css pour écraser les anciens réglages EPP.
*/

.epp-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: none;
  margin: 10px 0 18px;
}

.epp-check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #FAFAFA;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.epp-check-row:hover {
  background: #FFF8E0;
  border-color: var(--color-primary);
}

.epp-check-row input[type="checkbox"],
.epp-check-row input[type="radio"] {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--color-primary);
}

.epp-check-row span {
  line-height: 1.3;
}

.epp-non-concerne {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #FDECEC;
  color: #B42318;
  border: 1px solid #F5B5B5;
  font-weight: 700;
  font-size: 0.88rem;
}

.epp-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.epp-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.epp-dot-conforme { background: #36C275; }
.epp-dot-surveiller { background: #E6B73B; }
.epp-dot-retard { background: #D83A56; }
.epp-dot-bilan8 { background: #3E7BD6; }
.epp-dot-aucun { background: #6B7280; }



/* ================= EPP - SUIVI SIMPLIFIÉ FINAL ================= */

.epp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 12px 0 18px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.epp-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.epp-follow-table {
  table-layout: fixed;
  width: 100%;
}

.epp-follow-table th,
.epp-follow-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.epp-follow-table th:nth-child(1),
.epp-follow-table td:nth-child(1) {
  width: 25%;
}

.epp-follow-table th:nth-child(2),
.epp-follow-table td:nth-child(2) {
  width: 20%;
}

.epp-follow-table th:nth-child(3),
.epp-follow-table td:nth-child(3),
.epp-follow-table th:nth-child(4),
.epp-follow-table td:nth-child(4) {
  width: 13%;
  text-align: center;
}

.epp-follow-table th:nth-child(5),
.epp-follow-table td:nth-child(5) {
  width: 17%;
}

.epp-follow-table th:nth-child(6),
.epp-follow-table td:nth-child(6) {
  width: 12%;
  text-align: right;
}

.epp-subtext {
  display: block;
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.epp-status-line,
.epp-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.epp-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: 50%;
  flex: 0 0 11px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.epp-dot-conforme { background: #36C275; }
.epp-dot-surveiller { background: #E6B73B; }
.epp-dot-retard { background: #D83A56; }
.epp-dot-bilan8 { background: #3E7BD6; }
.epp-dot-aucun { background: #6B7280; }

@media (max-width: 900px) {
  .epp-follow-table {
    min-width: 850px;
  }

  .table-wrapper {
    overflow-x: auto;
  }
}

/* ==========================================
   EPP - TABLEAU SUIVI
========================================== */

.epp-follow-table {
  width: 100%;
  border-collapse: collapse;
}

.epp-follow-table th,
.epp-follow-table td {
  vertical-align: middle;
}

.epp-follow-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.epp-follow-table tbody tr:last-child {
  border-bottom: none;
}

.epp-follow-table .table-actions {
  text-align: center;
  width: 180px;
}

.epp-follow-table .table-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.epp-status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.epp-subtext {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.9em;
}

.epp-action-cell{
  text-align:center;
  vertical-align:middle;
}

.epp-action-cell .btn{
  display:inline-block;
  min-width:110px;
}

.epp-follow-table{
  width:100%;
  border-collapse:collapse;
}

.epp-follow-table tbody tr{
  border-bottom:1px solid #e5e7eb;
}

.epp-follow-table tbody tr:last-child{
  border-bottom:none;
}