.orders-list-party{
    display:block;
    max-width:220px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  /* ==========================================================================
   * Design tokens (harmonisés)
   * ========================================================================== */
  :root{
    --bg: #f7f9fc;
    --surface: #ffffff;
    --card: var(--surface);

    --text: #1f2937;
    --muted: #6b7280;

    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(16,24,40,.08);

    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-contrast: #ffffff;

    --radius: 14px;
    --radius-lg: 16px;

    --space: 12px;
  }

  @media (prefers-color-scheme: dark){
    :root{
      --bg: #0b1220;
      --surface: #0f172a;
      --card: var(--surface);

      --text: #e2e8f0;
      --muted: #94a3b8;

      --border: #1f2a44;
      --shadow: 0 10px 25px rgba(0,0,0,.35);

      --primary: #3b82f6;
      --primary-600: #2563eb;
      --primary-contrast: #0b1220;
    }
  }

  .orders-icon-btn,
  .patrimoine-icon-btn,
  .search-icon-btn{
    width:32px;
    height:32px;
    display:inline-grid;
    place-items:center;
    padding:0;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
  }
    .orders-icon-btn:hover,
  .patrimoine-icon-btn:hover,
  .search-icon-btn:hover{ background:rgba(37,99,235,.08); }
    .orders-icon-btn.danger:hover{
    border-color:#fecaca;
    background:#fff1f2;
    color:#dc2626;
  }

  .orders-icon-btn svg,
  .patrimoine-icon-btn svg,
  .search-icon-btn svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  /* ==========================================================================
   * Base
   * ========================================================================== */
  *{ box-sizing:border-box; }
  html, body{ height:100%; }
  body{
    margin:0;
    font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* fond “propre” + léger dégradé en mode clair */
    background:
      radial-gradient(1200px 600px at 100% -10%, #e9efff 0%, transparent 60%),
      linear-gradient(#fff, var(--bg));
  }
  @media (prefers-color-scheme: dark){
    body{ background: var(--bg); }
  }

  a{ color: inherit; }

  h1,h2,h3{ margin: 0 0 8px; }
  h3{ font-size: 18px; }

  .muted{ color: var(--muted); }
  [hidden]{ display:none !important; }
  .hidden{ display:none !important; }

  /* ==========================================================================
   * Layout global
   * ========================================================================== */
  .wrap{
    max-width: 1900px;
    margin: 0 auto;
    padding: 16px 20px 40px;

    min-height: 100vh;
    min-height: 100svh;

    display:flex;
    flex-direction:column;
  }

  .topbar{
    position: sticky;
    top: 0;
    z-index: 10;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;

    padding: 8px 14px;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(8px);

    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow);
  }
  @media (prefers-color-scheme: dark){
    .topbar{ background: rgba(15,23,42,.7); }
  }

  .topbar h1,
  .app-title-btn{
    margin:0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
  }

  .app-title-btn{
    appearance:none;
    border:0;
    padding:4px 2px;
    background:transparent;
    color:var(--text);
    font:inherit;
    cursor:pointer;
    border-radius:6px;
  }

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

  .app-title-btn:focus-visible{
    outline:none;
    box-shadow:0 0 0 3px rgba(37,99,235,.25);
  }

  .user{
    display:flex;
    align-items:center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
  }

  .user-menu{
    position:relative;
  }

  .user-menu-trigger{
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--border);
    border-radius:999px;
    background: var(--surface);
    color: var(--text);
    cursor:pointer;
    box-shadow: 0 4px 12px rgba(16,24,40,.08);
  }

  .user-menu-trigger:hover,
  .user-menu-trigger[aria-expanded="true"]{
    border-color:#94a3b8;
    background: rgba(37,99,235,.06);
  }

  .user-menu-trigger svg,
  .user-menu-item svg,
  .user-menu-success-icon svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .user-menu-panel{
    position:absolute;
    right:0;
    top:calc(100% + 10px);
    z-index: 50;
    width:min(280px, calc(100vw - 32px));
    padding:8px;
    background: var(--surface);
    color: var(--text);
    border:1px solid var(--border);
    border-radius:12px;
    box-shadow: var(--shadow);
  }

  .user-menu-head{
    display:grid;
    gap:2px;
    padding:10px 10px 8px;
    border-bottom:1px solid var(--border);
    margin-bottom:6px;
  }

  .user-menu-head strong{
    color: var(--text);
    overflow-wrap:anywhere;
  }

  .user-menu-head span{
    color: var(--muted);
    font-size:12px;
  }

  .user-menu-item{
    width:100%;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px;
    border:0;
    border-radius:8px;
    background: transparent;
    color: var(--text);
    text-align:left;
    cursor:pointer;
    font: inherit;
  }

  .user-menu-item:hover{
    background: rgba(37,99,235,.08);
  }

  .user-menu-success-icon{
    width:48px;
    height:48px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin:0 auto;
    border-radius:999px;
    background: rgba(22,163,74,.12);
    color:#16a34a;
  }

  .panel{
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    min-height: 160px;

    flex: 1;
    min-height: 0;
    display:flex;
    flex-direction:column;
  }

  #view{
    flex: 1;
    min-height: 0;
    display:flex;
    flex-direction:column;
  }
  #view > :first-child{
    flex: 1;
    min-height: 0;
  }

  /* Grid (cartes etc.) */
  .grid{
    display:grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  /* Spécifique home cards (si tu gardes #cards) */
  #cards.grid{
    margin-top: 12px;
    display: grid;
  }

  @media (max-width:780px){
    .topbar{ padding: 8px 12px; }
    .panel{ padding: 14px; }
  }

  /* ==========================================================================
   * Cards
   * ========================================================================== */
  .card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .card:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(16,24,40,.12);
  }
  .card h2{ margin: 0 0 6px; font-size: 18px; }
  .card p{ margin: 0 0 12px; color: var(--muted); font-size: 14px; }
  .card.danger{ border-color:#fecaca; background:#fff1f2; }

  /* Home : la carte devient un bouton */
  .card-btn{
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    font: inherit;
    display:flex;
    align-items:center;
    gap:8px;
    min-height:44px;
  }
  .card-btn:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.25);
  }
  .card-btn.is-active{
    border-color:rgba(37,99,235,.65);
    background:rgba(37,99,235,.08);
    box-shadow:0 8px 24px rgba(37,99,235,.14);
  }
  .card-btn.is-active .home-card-icon{
    background:var(--primary);
    color:#fff;
  }
  .home-card-icon{
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    border-radius:8px;
    background:rgba(37,99,235,.08);
    color:var(--primary);
  }
  .home-card-icon svg{
    width:16px;
    height:16px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }
  .card-title{
    margin: 0;
    font-size: 15px;
  }

  .system-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:8px;
  }

  /* ==========================================================================
   * Buttons
   * ========================================================================== */
  .btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap: 8px;

    padding: 10px 14px;
    border-radius: 999px;

    border: 1px solid var(--primary-600);
    background: var(--primary);
    color: var(--primary-contrast);

    text-decoration:none;
    font-weight: 600;
    cursor:pointer;

    transition: transform .04s ease, background .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 18px rgba(37,99,235,.25);
  }
  .btn:hover{ background: var(--primary-600); }
  .btn:active{ transform: translateY(1px); }
  .btn[disabled]{ opacity:.55; cursor:not-allowed; box-shadow:none; }

  .btn.btn-small,
  .btn-small{
    padding: 6px 10px;
    font-size: 12px;
    box-shadow: none;
  }

  /* Optionnel : bouton “secondaire” */
  .btn.secondary{
    border-color: var(--border);
    background: transparent;
    color: var(--text);
    box-shadow: none;
  }
  .btn.secondary:hover{
    background: rgba(0,0,0,.03);
  }
  @media (prefers-color-scheme: dark){
    .btn.secondary:hover{ background: rgba(255,255,255,.06); }
  }

  /* ==========================================================================
   * Forms (compat historique)
   * ========================================================================== */
  .row{
    display:grid;
    gap: 12px;
    margin: 8px 0;
    grid-template-columns: 1fr 1fr;
  }
  @media (max-width: 840px){
    .row{ grid-template-columns: 1fr; }
  }

  label{ display:flex; flex-direction:column; gap:6px; font-size: 14px; }

  input, select, textarea{
    width:100%;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  input::placeholder, textarea::placeholder{ color: #9aa3b2; }
  input:focus, select:focus, textarea:focus{
    outline:none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148,163,184,.25);
  }

  /* ==========================================================================
   * Tables (compat .table + .tbl)
   * ========================================================================== */
  table.table, table.tbl,
  .table{
    width:100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow:hidden;
  }

  table.table th, table.table td,
  table.tbl th, table.tbl td,
  .table th, .table td{
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align:left;
  }

  table.table thead th, table.tbl thead th,
  .table thead th{
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(2,6,23,.02);
  }
  @media (prefers-color-scheme: dark){
    table.table thead th, table.tbl thead th,
    .table thead th{
      background: rgba(255,255,255,.06);
      color: var(--text);
    }
  }

  table.table tbody tr:hover,
  table.tbl  tbody tr:hover,
  .table tbody tr:hover{
    background: rgba(59,130,246,.06);
  }


/* ==========================================================================
 * Actions de tableau (global)
 * ========================================================================== */
.table th:last-child,
.table td:last-child,
table.table th:last-child,
table.table td:last-child,
table.tbl th:last-child,
table.tbl td:last-child{
  text-align: right;
  white-space: nowrap;
}

.table .actions,
table.table .actions,
table.tbl .actions{
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table td:last-child .btn,
table.table td:last-child .btn,
table.tbl td:last-child .btn{
  padding: 6px 8px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-weight: 500;
}

.table td:last-child .btn:hover,
table.table td:last-child .btn:hover,
table.tbl td:last-child .btn:hover{
  background: rgba(2,6,23,.03);
}

.table td:last-child .btn:active,
table.table td:last-child .btn:active,
table.tbl td:last-child .btn:active{
  transform: translateY(1px);
}

@media (prefers-color-scheme: dark){
  .table td:last-child .btn:hover,
  table.table td:last-child .btn:hover,
  table.tbl td:last-child .btn:hover{
    background: rgba(255,255,255,.06);
  }
}


  /* ==========================================================================
   * MODALES (GLOBAL) — IMPORTANT : z-index + isolation
   * ========================================================================== */
  .modal{
    display:none;
    position:fixed;
    inset:0;
    background: rgba(0,0,0,.25);

    /* 🔥 pour passer au-dessus de tout */
    z-index: 999999;

    align-items:flex-start;
    justify-content:center;
    padding: clamp(12px, 6vh, 72px) 12px 24px;
    overflow:auto;

    /* 🔒 évite les soucis de stacking context / filtres */
    isolation: isolate;
  }
  .modal.is-open{ display:flex; }

  .modal-card{
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  #modalChangePassword .btn.btn-ghost{
    color: var(--text);
    border-color: var(--border);
  }

  .account-password-card{
    width:min(520px, 96vw);
    padding:18px;
  }

  .account-password-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
  }

  .account-password-head h3{ margin:0; }

  .account-password-form{
    display:grid;
    gap:12px;
  }

  .account-password-help{ margin:0; }

  .account-password-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:wrap;
  }

  .account-password-success{
    display:grid;
    gap:14px;
    text-align:center;
    padding:12px 0 4px;
  }

  .account-password-success h3{ margin:0 0 6px; }
  .account-password-success p{ margin:0; }
  .account-password-success-actions{
    display:flex;
    justify-content:center;
  }

  /* ==========================================================================
   * Progression globale
   * ========================================================================== */
  .app-progress-wrap{
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1200;
    width: min(980px, calc(100vw - 32px));
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
  }

  .app-progress{
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,.28);
    overflow: hidden;
  }

  .app-progress .bar{
    height: 100%;
    width: 40%;
    background: var(--primary);
    animation: helios-indeterminate 1s linear infinite;
  }

  .app-progress-text{
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
  }

  @supports not (background: color-mix(in srgb, white 90%, transparent)){
    .app-progress-wrap{ background: var(--surface); }
  }

  @media (max-width: 640px){
    .app-progress-wrap{
      bottom: 10px;
      width: calc(100vw - 20px);
    }
  }

  /* ==========================================================================
 * Page Login (scopé)
 * ========================================================================== */
.login-view{
  /* rendu “dark” login, branché tokens */
  --lv-page: #0b1220;
  --lv-card: #0f172a;
  --lv-fg:   #e5e7eb;
  --lv-muted:#9ca3af;
  --lv-border:#334155;
  --lv-input:#0b1220;
  --lv-shadow: 0 22px 70px rgba(0,0,0,.45);

  color-scheme: dark;
  color: var(--lv-fg);

  margin: -18px;
  padding: 34px 22px;
  border-radius: calc(var(--radius) - 2px);

  background:
    radial-gradient(900px 420px at 15% 0%, rgba(37,99,235,.22) 0%, transparent 62%),
    radial-gradient(900px 420px at 85% 10%, rgba(29,78,216,.14) 0%, transparent 58%),
    linear-gradient(#0b1220, #070c16);
}

.login-shell{
  min-height: 62vh;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction: column; /* important si progress sous la carte */
}

.login-card{
  width: min(980px, 100%);
  display:grid;
  grid-template-columns: 1.1fr .9fr;

  background: var(--lv-card);
  border: 1px solid var(--lv-border);
  border-radius: 18px;
  overflow:hidden;
  box-shadow: var(--lv-shadow);
}

.login-side{
  position: relative;
  padding: 26px 26px;
  color: #fff;

  background:
    radial-gradient(560px 560px at 86% -10%,
      rgba(255,255,255,.06) 0%,
      rgba(255,255,255,.03) 28%,
      rgba(255,255,255,0) 68%
    ),
    repeating-conic-gradient(from -12deg at 86% -10%,
      rgba(255,255,255,.10) 0 14deg,
      rgba(255,255,255,0)   14deg 42deg
    ),
    radial-gradient(600px 280px at 30% 20%,
      rgba(255,255,255,.18) 0%,
      transparent 60%
    ),
    linear-gradient(135deg, #60a5fa 0%, var(--primary) 55%, #1e3a8a 100%);

  display:flex;
  align-items:flex-end;
  min-height: 280px;
}

.brand{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:8px;
  max-width: 420px;
}
.brand .logo{
  font-size: 44px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1;
}
.brand .tagline{
  font-size: 22px;
  opacity: .92;
}
.brand .version{
  font-size: 16px;
  opacity: .8;
}

.login-main{
  padding: 26px 28px;
  color: var(--lv-fg);
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 14px;
}

.login-main h3{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}

.login-main .muted{
  margin: 0;
  color: var(--lv-muted);
  font-size: 13px;
}

.login-fields{
  display:flex;
  flex-direction:column;
  gap: 12px;
  margin-top: 6px;
}

.login-fields label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size: 13px;
  color: var(--lv-fg);
}

.login-fields input{
  width:100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--lv-border);
  background: var(--lv-input);
  color: var(--lv-fg);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.login-fields input:focus{
  border-color:#94a3b8;
  box-shadow: 0 0 0 3px rgba(148,163,184,.25);
}

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

.login-password-field input{
  padding-right: 46px;
}

.login-eye-btn{
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius: 10px;
  background: transparent;
  color: var(--lv-muted);
  cursor:pointer;
}

.login-eye-btn:hover{
  background: rgba(148,163,184,.16);
  color: var(--lv-fg);
}

.login-eye-btn svg{
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Messages */
.login-msg{
  min-height: 20px;
  margin-top: 8px;
  font-size: 0.95rem;
}
.login-msg.is-success{ color: #16a34a; }
.login-msg.is-error{ color: #dc2626; }

/* Actions : tout centré */
.login-actions{
  display:flex;
  flex-direction:column;
  align-items:center;     /* <-- centre horizontalement */
  gap: 10px;
  margin-top: 10px;
}

/* Boutons côte à côte ET centrés */
.login-cta{
  display:flex;
  justify-content:center; /* <-- centre le bloc de boutons */
  align-items:center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;            /* <-- permet un centrage propre dans la colonne */
}

/* Boutons: pas en full width */
.login-cta .btn{
  width: auto;
}

/* Lien "Mot de passe oublié" centré sous les boutons */
.login-forgot{
  margin: 0;
  font-size: 13px;
  color: var(--lv-muted);
  text-align: center;     /* <-- centre le texte */
  width: 100%;
}

.login-forgot a,
.link{
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(156,163,175,.55);
}
.login-forgot a:hover,
.link:hover{
  border-bottom-style: solid;
}

/* Bouton secondaire */
.btn.btn-ghost{
  background: transparent;
  color: var(--lv-fg);
  border: 1px solid var(--lv-border);
}

/* Progress SOUS la carte */
.login-progress-wrap{
  width: min(980px, 100%);
  margin-top: 12px;
}

.login-progress{
  height: 6px;
  border-radius: 999px;
  background: rgba(51,65,85,.55); /* cohérent avec le thème login */
  overflow: hidden;
}

.login-progress .bar{
  height: 100%;
  width: 40%;
  background: var(--primary);
  animation: helios-indeterminate 1s linear infinite;
}

@keyframes helios-indeterminate{
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

.login-loading-text{
  margin-top: 8px;
  color: var(--lv-muted);
  font-size: 13px;
}

.login-request-card{
  width:min(520px, 96vw);
  padding:18px;
  background: var(--lv-card);
  color: var(--lv-fg);
  border-color: var(--lv-border);
}

.login-request-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}

.login-request-head h3{
  margin:0;
}

@media (max-width: 860px){
  .login-card{ grid-template-columns: 1fr; }
  .login-side{ min-height: 220px; }

  /* Sur mobile, on garde côte à côte tant que possible */
  .login-actions{
    align-items:flex-start;
  }
}

/* Sécurité : si écran ultra étroit, on autorise le wrap */
@media (max-width: 360px){
  .login-cta{
    flex-wrap: wrap;
    white-space: normal;
    justify-content:flex-start;
  }

  .login-password-field input{
    padding-right: 42px;
  }
}
  /* ==========================================================================
   * NotFound (scopé)
   * ========================================================================== */
  .nf-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 28px 12px;
  }

  .nf-card{
    max-width: 720px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
    text-align: left;
  }

  .nf-head{
    display:flex;
    gap: 14px;
    align-items:center;
    margin-bottom: 6px;
  }

  .nf-icon{
    width: 44px;
    height: 44px;
    display:grid;
    place-items:center;
    border-radius: 12px;
    background: rgba(2,6,23,.04);
    font-size: 20px;
  }

  .nf-icon svg{
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .nf-actions{
    display:flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
  }

  .nf-title{ margin:0; }
  .nf-text{ margin:6px 0 0; }

  /* ==========================================================================
   * USERS (scopé)
   * ========================================================================== */
  .users-view .tbl{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background: var(--surface);
    color: var(--text);
    border:1px solid var(--border);
    border-radius: var(--radius);
    overflow:hidden;
  }

  .users-view .tbl th,
  .users-view .tbl td{
    border-bottom:1px solid var(--border);
    padding:8px 10px;
    vertical-align: middle;
  }

  .users-view .tbl thead th{
    background: rgba(2,6,23,.02);
    font-weight: 600;
  }

  .users-view .tbl tbody tr:hover{
    background: rgba(2,6,23,.03);
  }

  .users-view .tbl tbody tr.is-inactive{
    background: rgba(148,163,184,.08);
  }

  .users-view .tbl tbody tr.is-inactive:hover{
    background: rgba(148,163,184,.14);
  }

  .users-view .tbl tbody tr.is-inactive td:not(:last-child){
    color: var(--muted);
  }

  .users-view .tbl tbody tr.is-inactive .actions,
  .users-view .tbl tbody tr.is-inactive .providers-row-actions{
    opacity:.78;
  }

  .users-view .tbl input,
  .users-view .tbl select{
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
  }
    .users-feedback-icon svg{
    width:17px;
    height:17px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .users-feedback-card{
    width:min(460px, 96vw);
    padding:18px;
    display:grid;
    gap:10px;
    text-align:center;
  }

  .users-feedback-card h3,
  .users-feedback-card p{
    margin:0;
  }

  .users-feedback-icon{
    width:44px;
    height:44px;
    margin:0 auto;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background: rgba(37,99,235,.10);
    color: var(--primary);
  }

  .users-feedback-actions{
    display:flex;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
    margin-top:4px;
  }

  .users-view .muted{ color: var(--muted); }

    /* ==========================================================================
   * ORDERS (scopé)
   * ========================================================================== */
  .orders-view .tbl{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background: var(--surface);
    color: var(--text);
    border:1px solid var(--border);
    border-radius: var(--radius);
    overflow:hidden;
  }

  .orders-view .tbl th,
  .orders-view .tbl td{
    border-bottom:1px solid var(--border);
    padding:8px 10px;
    vertical-align: middle;
  }

  .orders-view .tbl thead th{
    background: rgba(2,6,23,.02);
    font-weight: 600;
  }

  .orders-view .tbl tbody tr:hover{
    background: rgba(2,6,23,.03);
  }

  .orders-view .tbl input,
  .orders-view .tbl select,
  .orders-view #modalOrderNew input,
  .orders-view #modalOrderNew select,
  .orders-view #modalOrderNew textarea{
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
  }

  .orders-view .muted{ color: var(--muted); }

  .orders-view .sortable{
    cursor: pointer;
    user-select: none;
  }

  .orders-view .sortable.sort-asc::after{
    content:" ▲";
    font-size:11px;
  }

  .orders-view .sortable.sort-desc::after{
    content:" ▼";
    font-size:11px;
  }

  /* ==========================================================================
   * ORDER NEW (scopé)
   * ========================================================================== */
  .order-new-view{
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .order-create-form{
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .order-new-actions{
    display:flex;
    gap:10px;
    justify-content:flex-end;
    flex-wrap:wrap;
    padding-top:4px;
  }

  /* ==========================================================================
   * Module patrimoine
   * ========================================================================== */
  .patrimoine-view{
    display:flex;
    flex-direction:column;
    gap:16px;
  }

  .patrimoine-section h4{ margin:0; }

  .patrimoine-section p{ margin:4px 0 0; }

  .patrimoine-section{
    display:grid;
    gap:10px;
  }

  .patrimoine-actions,
  .patrimoine-actions-cell,
  .patrimoine-modal-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
  }

  .patrimoine-actions-cell{ justify-content:flex-end; }

  .patrimoine-tab-actions{
    justify-content:flex-end;
  }

  .patrimoine-tab-actions select{
    min-width:260px;
  }

  .patrimoine-select-mail{
    width:32px;
    height:32px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
  }

  .patrimoine-select-mail input{
    width:16px;
    height:16px;
    margin:0;
  }

  .sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
  }

  .patrimoine-table-wrap{ max-width:100%; }
  .patrimoine-table{ min-width:900px; }

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

  .patrimoine-filters input,
  .patrimoine-filters select,
  .search-table-filters input{
    width:100%;
    min-width:120px;
    padding:6px 8px;
    font-size:13px;
  }

  .patrimoine-subfilters input{ min-width:100px; }

  .patrimoine-icon-btn{
    width:32px;
    height:32px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
  }

  .patrimoine-icon-btn svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .patrimoine-subrow > td{
    background:rgba(148,163,184,.08);
    padding:10px;
  }

  .patrimoine-subcard{
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    overflow:hidden;
  }

  .patrimoine-subhead{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    padding:10px 12px;
    border-bottom:1px solid var(--border);
    background:rgba(148,163,184,.08);
  }

  .patrimoine-subhead > div:first-child{
    display:grid;
    gap:2px;
  }

  .patrimoine-modal-card{
    width:min(760px, 96vw);
    max-height:92vh;
    overflow:auto;
    padding:18px;
  }

  .patrimoine-mail-card{ width:min(900px, 96vw); }

  .patrimoine-modal-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:14px;
  }

  .patrimoine-modal-head h3,
  .patrimoine-modal-head p{ margin:0; }

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

  .patrimoine-form .patrimoine-modal-actions{
    grid-column:1 / -1;
    justify-content:flex-end;
  }

  .patrimoine-mail-toolbar{
    display:flex;
    gap:8px;
    align-items:center;
    margin-bottom:10px;
  }

  .patrimoine-mail-toolbar input{ flex:1 1 auto; }

  .patrimoine-mail-table-wrap{
    max-height:360px;
    overflow:auto;
  }

  .patrimoine-check-cell{
    width:46px;
    text-align:center;
  }

  .patrimoine-feedback-card{
    width:min(460px, 94vw);
    text-align:center;
    display:grid;
    gap:12px;
  }

  .patrimoine-feedback-icon{
    width:48px;
    height:48px;
    margin:0 auto;
    display:grid;
    place-items:center;
    border-radius:999px;
  }

  .patrimoine-feedback-icon.is-success,
  .patrimoine-feedback-icon.is-info{
    background:rgba(22,163,74,.12);
    color:#16a34a;
  }

  .patrimoine-feedback-icon.is-warning{
    background:rgba(220,38,38,.12);
    color:#dc2626;
  }

  .patrimoine-feedback-icon svg{
    width:24px;
    height:24px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .patrimoine-feedback-actions{ justify-content:center; }

  @media (max-width: 760px){
    .patrimoine-actions{ width:100%; }
    .patrimoine-tab-actions select,
    .patrimoine-actions .btn{ width:100%; }
    .patrimoine-mail-toolbar{
      flex-direction:column;
      align-items:stretch;
    }
  }

  /* ==========================================================================
   * Documents / Upload
   * ========================================================================== */
  .module-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
  }

  .module-head h3{ margin:0; }
  .module-head p{ margin:4px 0 0; }

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

  .table-filter-control{
    width:100%;
    min-width:120px;
    padding:4px 6px;
    font-size:13px;
  }

  .module-table-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    margin-top:8px;
    flex-wrap:wrap;
  }

  .search-status{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:6px 0 10px;
  }

  .search-pager{
    display:flex;
    gap:8px;
    align-items:center;
  }

  .search-table-wrap{ max-width:100%; }
  .search-table{
    min-width:1240px;
    table-layout:fixed;
  }

  .search-col-date{ width:108px; }
  .search-col-document{ width:280px; }
  .search-col-patrimoine{ width:220px; }
  .search-col-code{ width:92px; }
  .search-col-command{ width:130px; }
  .search-col-actions{ width:190px; }

  .search-filter-stack{
    display:grid;
    gap:6px;
  }

  .search-doc-cell{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:220px;
  }

  .search-doc-cell strong,
  .search-doc-cell span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .search-patrimoine-cell{ min-width:0; }

  .search-table .actions{
    flex-wrap:nowrap;
  }

  .search-icon-btn{
    width:32px;
    height:32px;
    display:inline-grid;
    place-items:center;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
  }

  .search-icon-btn svg,
  .search-feedback-icon svg,
  .upload-feedback-icon svg,
  .orders-feedback-icon svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .search-modal-card{
    width:min(760px, 94vw);
    padding:16px;
    display:grid;
    gap:12px;
  }

  .search-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
  }

  .search-modal-head h3,
  .search-modal-head p{ margin:0; }

  .search-modal-actions,
  .upload-modal-actions{
    display:flex;
    gap:8px;
    justify-content:flex-end;
    align-items:center;
    flex-wrap:wrap;
  }

  .search-edit-card{ width:min(860px, 94vw); }
  .search-upload-card{ width:min(1180px, 96vw); }

  .search-edit-form{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
  }

  .search-edit-form label:nth-child(3),
  .search-edit-form label:nth-child(4),
  .search-edit-form .search-modal-actions{
    grid-column:1 / -1;
  }

  .search-preview-card{
    width:min(1100px, 96vw);
    height:min(820px, 92vh);
    padding:12px;
  }

  .search-preview-frame{
    width:100%;
    min-height:680px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
  }

  .search-feedback-card,
  .upload-feedback-card,
  .orders-feedback-card{
    width:min(460px, 94vw);
    padding:18px;
    text-align:center;
    display:grid;
    gap:12px;
  }

  .search-feedback-card h3,
  .search-feedback-card p,
  .upload-feedback-card h3,
  .upload-feedback-card p,
  .orders-feedback-card h3,
  .orders-feedback-card p{ margin:0; }

  .search-feedback-icon,
  .upload-feedback-icon,
  .orders-feedback-icon{
    width:48px;
    height:48px;
    margin:0 auto;
    display:grid;
    place-items:center;
    border-radius:999px;
  }

  .search-feedback-icon.is-success,
  .search-feedback-icon.is-info,
  .upload-feedback-icon.is-success,
  .upload-feedback-icon.is-info,
  .orders-feedback-icon.is-success,
  .orders-feedback-icon.is-info{
    background:rgba(22,163,74,.12);
    color:#16a34a;
  }

  .search-feedback-icon.is-warning,
  .upload-feedback-icon.is-warning,
  .orders-feedback-icon.is-warning{
    background:rgba(220,38,38,.12);
    color:#dc2626;
  }

  .search-feedback-actions,
  .orders-feedback-actions{ justify-content:center; }

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

  .orders-small-modal-card{
    width:min(420px, 95vw);
    max-height:90vh;
    overflow:auto;
    padding:16px;
  }

  .orders-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    margin-bottom:10px;
  }

  .orders-modal-head h3{ margin:0; }
  .orders-modal-info{ margin:0 0 10px; }
  .orders-modal-msg{ margin-top:10px; }

  .orders-form-stack{
    display:flex;
    flex-direction:column;
    gap:8px;
  }

  .orders-form-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:10px;
  }

  .orders-doc-type-choice-list{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
    gap:6px 10px;
    max-height:260px;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:8px;
    padding:8px;
    background:rgba(148,163,184,.06);
  }

  .orders-doc-type-choice{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    padding:6px 8px;
    border-radius:6px;
  }

  .orders-doc-type-choice:hover{
    background:rgba(148,163,184,.10);
  }

  .orders-doc-type-choice input{
    flex:0 0 auto;
  }

  .orders-doc-type-choice span{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .orders-file-input{ padding:6px 0; }
  .orders-file-info{ margin:0; }

  .orders-large-modal-card,
  .orders-xl-modal-card{
    max-height:92vh;
    overflow:auto;
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:16px;
  }

  .orders-large-modal-card{ width:min(1100px, 96vw); }
  .orders-xl-modal-card{ width:min(1500px, 96vw); }

  .orders-edit-head,
  .orders-section-head,
  .orders-dest-actions,
  .orders-upload-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }

  .orders-section-head{
    align-items:center;
    justify-content:space-between;
  }

  .orders-section-head{ margin-bottom:10px; }

  .orders-section-head h3,
  .orders-section-head h4{ margin:0; }

  .orders-edit-head{
    align-items:flex-start;
    justify-content:space-between;
    margin-bottom:12px;
  }

  .orders-edit-head h2{ margin:0 0 6px; }
  .orders-edit-head p{ margin:0; }

  .orders-edit-nav{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
    margin:-2px 0 10px;
  }

  .orders-edit-nav-btn{
    min-width:104px;
    height:42px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    font-weight:700;
    cursor:pointer;
    padding:0 10px;
  }

  .orders-edit-nav-btn:hover{
    border-color:var(--primary);
  }

  .orders-edit-nav-btn.is-active{
    border-color:var(--primary);
    background:rgba(37,99,235,.10);
    color:var(--primary);
  }

  .orders-edit-nav-icon{
    width:18px;
    height:18px;
    display:inline-grid;
    place-items:center;
    flex:0 0 auto;
  }

  .orders-edit-nav-icon svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .orders-edit-section{
    display:none;
  }

  .orders-edit-section.is-active{
    display:block;
  }

  .orders-section-card{ margin-bottom:12px; }

  .orders-command-pdf-panel{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:10px 12px;
    margin-bottom:10px;
  }

  .orders-command-pdf-panel p{
    margin:4px 0 0;
  }

  .orders-command-pdf-upload-row{
    margin-bottom:12px;
  }

  .orders-command-pdf-upload-row input[type="file"]{
    max-width:360px;
  }

  .orders-invoices-table .num{
    text-align:right;
    white-space:nowrap;
  }

  .orders-invoices-table td small{
    display:block;
    color:var(--muted);
    margin-top:2px;
    max-width:300px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .orders-invoice-detail-row > td{
    padding-top:0;
    background:rgba(148,163,184,.06);
  }

  .orders-invoice-lines-detail{
    border-left:3px solid var(--border);
    padding:8px 0 10px 12px;
  }

  .orders-invoice-detail-table{
    width:100%;
    min-width:680px;
    margin:0;
  }

  .orders-invoice-detail-table th,
  .orders-invoice-detail-table td{
    padding:7px 8px;
  }

  .orders-invoice-detail-table .num{
    text-align:right;
    white-space:nowrap;
  }

  .orders-unpaid{
    color:#b45309;
    font-weight:700;
  }

  .orders-invoice-lines-block{
    margin-top:8px;
  }

  .orders-invoice-lines-table{
    min-width:760px;
  }

  .orders-invoice-lines-table input{
    width:100px;
    min-width:0;
  }

  .orders-analysis-modal-card{
    width:min(980px, 96vw);
  }

  .orders-analysis-summary{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:14px;
    align-items:center;
    border:1px solid var(--border);
    border-radius:8px;
    background:rgba(148,163,184,.06);
    padding:10px 12px;
  }

  .orders-analysis-summary-main{
    min-width:0;
  }

  .orders-analysis-summary-main span,
  .orders-analysis-summary-metrics span{
    display:block;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
  }

  .orders-analysis-summary-main strong{
    display:block;
    margin-top:3px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .orders-analysis-summary-metrics{
    display:flex;
    gap:14px;
    align-items:center;
  }

  .orders-analysis-summary-metrics div{
    min-width:82px;
    text-align:right;
  }

  .orders-analysis-summary-metrics strong{
    display:block;
    margin-top:3px;
    font-size:15px;
  }

  .orders-analysis-entry-panel{
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px;
  }

  .orders-analysis-existing-block{
    margin-top:2px;
  }

  .orders-analysis-lab-table{
    min-width:620px;
  }

  .orders-analysis-lab-table th,
  .orders-analysis-lab-table td{
    padding:8px 9px;
  }

  .orders-analysis-lab-table .num{
    text-align:right;
    white-space:nowrap;
  }

  .orders-analysis-entry-form{
    display:grid;
    grid-template-columns:minmax(220px, 1fr) minmax(110px, 140px) minmax(150px, 180px);
    gap:10px;
    align-items:end;
  }

  .orders-analysis-entry-form label{
    min-width:0;
  }

  .orders-analysis-entry-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:10px;
  }

  .orders-analysis-entry-footer .orders-modal-msg{
    margin:0;
  }

  @media (max-width: 760px){
    .orders-analysis-summary{
      grid-template-columns:1fr;
    }

    .orders-analysis-summary-metrics{
      justify-content:space-between;
    }

    .orders-analysis-summary-metrics div{
      text-align:left;
      min-width:0;
    }

    .orders-analysis-entry-form{
      grid-template-columns:1fr;
    }

    .orders-analysis-entry-footer{
      align-items:flex-start;
      flex-direction:column;
    }
  }

  .orders-invoice-edit-head-form{
    display:grid;
    grid-template-columns:minmax(150px, 180px) minmax(190px, 1fr) minmax(150px, 180px) auto;
    gap:10px;
    align-items:end;
  }

  .orders-invoice-edit-head-form label{
    min-width:0;
  }

  .orders-invoice-edit-nav{
    margin-top:4px;
  }

  @media (max-width: 760px){
    .orders-invoice-edit-head-form{
      grid-template-columns:1fr;
    }
  }

  .orders-meta-form{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:flex-end;
  }

  .orders-meta-short{ min-width:110px; }
  .orders-meta-medium{ min-width:160px; }
  .orders-meta-ref{ min-width:180px; }
  .orders-meta-long{ min-width:240px; }

  .orders-edit-actions{
    display:flex;
    gap:8px;
    align-items:flex-end;
    flex-wrap:wrap;
  }

  .orders-status-msg{ margin:10px 0 0; }
  .orders-dest-actions{ align-items:center; }
  .orders-dest-users-toolbar{
    display:flex;
    justify-content:flex-start;
    align-items:center;
    margin:0 0 10px;
  }
  .orders-checkline{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:600;
  }
  .orders-upload-row{ align-items:center; }

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

  .orders-missions-table > tbody > tr[data-mission-id] > td{
    border-bottom:0;
  }

  .orders-mission-detail-row > td{
    padding-top:0;
    background:rgba(148,163,184,.08);
    border-bottom:1px solid var(--border);
  }

  .orders-mission-empty{
    margin:8px 0;
  }

  .orders-mission-lines-scroll{
    overflow:auto;
    max-width:100%;
    padding-bottom:2px;
  }

  .orders-analysis-actions{
    display:flex;
    gap:6px;
    flex:0 0 auto;
  }

  .orders-analysis-actions .orders-icon-btn,
  .orders-analysis-actions .providers-icon-btn{
    width:28px;
    height:28px;
  }

  .orders-mission-mini-table{
    width:100%;
    min-width:1040px;
    border-collapse:collapse;
    font-size:12px;
  }

  .orders-mission-mini-table th,
  .orders-mission-mini-table td{
    padding:3px 4px;
    border-bottom:1px solid var(--border);
    vertical-align:middle;
  }

  .orders-mission-mini-table thead th{
    color:var(--muted);
    font-weight:600;
    text-align:left;
  }

  .orders-mission-mini-table .num{
    text-align:right;
    white-space:nowrap;
  }

  .orders-mission-mini-table tfoot th{
    font-weight:700;
    background:rgba(15,23,42,.03);
  }

  .orders-mission-mini-table tfoot tr:last-child th{
    border-bottom:0;
  }

  .orders-mini-code{
    max-width:110px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .orders-mini-actions{
    width:62px;
    padding-right:0;
  }

  .orders-mini-actions .orders-analysis-actions{
    justify-content:flex-end;
    gap:4px;
  }

  .orders-mini-actions .providers-icon-btn{
    width:24px;
    height:24px;
  }

  .orders-mission-lines-modal-card{
    width:min(1280px, 96vw);
  }

  .orders-mission-line-picker-wrap{
    overflow:auto;
    border:1px solid var(--border);
    border-radius:8px;
  }

  .orders-mission-line-picker{
    min-width:1060px;
  }

  .orders-mission-line-picker th,
  .orders-mission-line-picker td{
    vertical-align:middle;
  }

  .orders-mission-line-picker input{
    width:96px;
    min-width:0;
  }

  .orders-mission-line-picker .num{
    text-align:right;
    white-space:nowrap;
  }

  .upload-grid{
    display:grid;
    grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
    gap:14px;
  }

  .upload-panel{
    border:1px solid var(--border);
    border-radius:8px;
    padding:14px;
    background:var(--surface);
  }

  .upload-panel h4{
    margin:0 0 12px;
    font-size:15px;
  }

  .upload-target-grid,
  .upload-meta-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
    margin-top:10px;
  }

  .upload-actions-inline{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:12px;
  }

  .upload-progress{
    display:grid;
    gap:6px;
    margin-top:12px;
  }

  .upload-progress[hidden]{ display:none; }

  .upload-progress-bar{
    height:8px;
    border-radius:999px;
    background:rgba(148,163,184,.28);
    overflow:hidden;
  }

  .upload-progress-bar span{
    display:block;
    width:0;
    height:100%;
    border-radius:inherit;
    background:var(--primary);
    transition:width .15s ease;
  }

  @media (max-width: 860px){
    .module-head,
    .search-status{
      flex-direction:column;
      align-items:stretch;
    }

    .module-actions,
    .search-pager,
    .upload-actions-inline{ justify-content:stretch; }

    .module-actions .btn,
    .search-pager .btn,
    .upload-actions-inline .btn{ width:100%; }

    .search-edit-form,
    .upload-grid,
    .upload-target-grid,
    .upload-meta-grid{ grid-template-columns:1fr; }
  }


  .providers-view{
    display:flex;
    flex-direction:column;
    gap:16px;
  }

  .clients-msg{
    margin:6px 0 0;
  }

  .clients-msg:empty{
    display:none;
  }

  .clients-msg.is-success{ color:#15803d; }
  .clients-msg.is-warning{ color:#b91c1c; }

  .devis-view{
    gap:10px;
  }

  .devis-msg{
    min-height:0;
  }

  .devis-table{
    min-width:0;
  }

  .devis-view .sortable,
  .devis-detail-modal-card .sortable{
    cursor:pointer;
    user-select:none;
  }

  .devis-view .sortable.sort-asc::after,
  .devis-detail-modal-card .sortable.sort-asc::after{
    content:" \25B2";
    font-size:11px;
  }

  .devis-view .sortable.sort-desc::after,
  .devis-detail-modal-card .sortable.sort-desc::after{
    content:" \25BC";
    font-size:11px;
  }

  .devis-table-filters th{
    padding-top:6px;
  }

  .devis-table-filters input,
  .devis-table-filters select{
    width:100%;
    min-width:0;
    padding:6px 8px;
    font-size:13px;
  }

  .devis-form{
    grid-template-columns:minmax(140px, 1fr) minmax(190px, 1.25fr) minmax(190px, 1.25fr) minmax(145px, .8fr) minmax(145px, .8fr);
  }

  .devis-detail-modal-card{
    width:min(1320px, 96vw);
    max-width:min(1320px, calc(100vw - 28px));
  }

  .devis-detail-nav{
    margin-top:10px;
  }

  .providers-form.devis-detail-header-form{
    display:grid;
    grid-template-columns:minmax(110px, .8fr) minmax(145px, 1fr) minmax(150px, 1fr) minmax(145px, 1fr) minmax(115px, .7fr) minmax(115px, .7fr) auto;
    gap:8px;
    align-items:end;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:10px 12px;
    margin-bottom:10px;
  }

  .providers-modal-actions.devis-detail-actions{
    grid-column:auto;
    align-items:center;
    gap:8px;
    flex-wrap:nowrap;
    justify-content:flex-end;
    align-self:end;
  }

  .devis-detail-command-status{
    margin-right:auto;
  }

  .devis-articles-head,
  .devis-command-panel{
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:10px 12px;
    margin-bottom:12px;
  }

  .devis-articles-head{
    margin-bottom:10px;
  }

  .devis-tarif-picker-table td,
  .devis-tarif-picker-table th{
    vertical-align:middle;
  }

  .devis-tarif-picker-table th:first-child,
  .devis-tarif-picker-table td:first-child{
    width:42px;
    text-align:center;
  }

  .devis-tarif-picker-table .devis-tarif-qty{
    max-width:90px;
  }

  .devis-tarif-picker-table tr.is-disabled{
    opacity:.55;
  }

  .devis-command-panel{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
  }

  .devis-command-panel p{
    margin:4px 0 0;
  }

  .devis-pdf-panel{
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:10px 12px;
  }

  .devis-pdf-panel{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
  }

  .devis-pdf-panel p{
    margin:4px 0 0;
  }

  @media (max-width: 1050px){
    .providers-form.devis-detail-header-form{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .providers-modal-actions.devis-detail-actions{
      grid-column:1 / -1;
      justify-content:flex-end;
    }
  }

  .synthese-view{
    display:flex;
    flex-direction:column;
    gap:10px;
  }

  .synthese-kpis{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(125px, 1fr));
    gap:8px;
    margin-bottom:10px;
  }

  .synthese-kpi{
    border:1px solid var(--border);
    border-radius:8px;
    padding:8px 10px;
    background:var(--surface);
    min-height:58px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:4px;
  }

  .synthese-kpi span{
    color:var(--muted);
    font-size:12px;
  }

  .synthese-kpi strong{
    font-size:18px;
    line-height:1.1;
  }

  .synthese-filters{
    display:grid;
    grid-template-columns:minmax(180px, 1.4fr) minmax(170px, 1fr) minmax(170px, 1fr) auto auto;
    gap:8px;
    align-items:center;
    margin-bottom:8px;
  }

  .synthese-filters input,
  .synthese-filters select{
    min-width:0;
  }

  .synthese-check{
    display:inline-flex;
    align-items:center;
    gap:6px;
    color:var(--muted);
    font-size:13px;
    white-space:nowrap;
  }

  .synthese-table{
    min-width:1360px;
    border-collapse:separate;
    border-spacing:0;
  }

  .synthese-table thead th{
    position:sticky;
    top:0;
    z-index:2;
    background:var(--surface);
    vertical-align:bottom;
  }

  .synthese-table tbody tr{
    transition:background .15s ease;
  }

  .synthese-table tbody tr:hover{
    background:rgba(37,99,235,.05);
  }

  .synthese-table tbody tr.has-alerts{
    box-shadow:inset 3px 0 0 rgba(245,158,11,.55);
  }

  .synthese-col-main{
    min-width:170px;
  }

  .synthese-col-ref{
    min-width:130px;
  }

  .synthese-col-status{
    min-width:150px;
  }

  .synthese-col-actions{
    width:74px;
  }

  .synthese-table td small{
    display:block;
    color:var(--muted);
    margin-top:2px;
  }

  .synthese-table .num{
    text-align:right;
    white-space:nowrap;
  }

  .synthese-ref{
    display:grid;
    gap:2px;
    min-width:0;
  }

  .synthese-ref strong{
    font-size:13px;
    line-height:1.25;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .synthese-main-cell .synthese-ref strong{
    white-space:normal;
  }

  .synthese-facture{
    display:grid;
    gap:2px;
    justify-items:end;
  }

  .synthese-facture strong{
    font-size:13px;
  }

  .synthese-status{
    display:inline-flex;
    align-items:center;
    max-width:145px;
    padding:3px 8px;
    border-radius:999px;
    border:1px solid var(--border);
    background:rgba(148,163,184,.12);
    color:var(--text);
    font-size:12px;
    font-weight:700;
    line-height:1.25;
    white-space:normal;
  }

  .synthese-status.is-ok{
    border-color:rgba(22,163,74,.28);
    background:rgba(22,163,74,.10);
    color:#166534;
  }

  .synthese-status.is-due{
    border-color:rgba(37,99,235,.25);
    background:rgba(37,99,235,.10);
    color:#1d4ed8;
  }

  .synthese-status.is-warning{
    border-color:rgba(245,158,11,.35);
    background:rgba(245,158,11,.10);
    color:#92400e;
  }

  .synthese-money-due{
    color:#b45309;
    font-weight:700;
  }

  .synthese-qty{
    display:grid;
    gap:3px;
    min-width:120px;
    font-size:12px;
  }

  .synthese-qty span{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:2px 8px;
    color:var(--muted);
    white-space:nowrap;
  }

  .synthese-qty span.is-due{
    color:#b45309;
    font-weight:700;
  }

  .synthese-qty strong{
    color:inherit;
  }

  .synthese-qty em{
    justify-self:end;
    color:inherit;
    font-style:normal;
  }

  .synthese-qty small{
    display:block;
    grid-column:1 / -1;
    margin-top:1px;
    color:var(--muted);
    font-weight:400;
  }

  .synthese-alerts{
    display:flex;
    gap:4px;
    flex-wrap:wrap;
    min-width:160px;
  }

  .synthese-alerts span{
    display:inline-flex;
    align-items:center;
    border:1px solid rgba(245,158,11,.35);
    background:rgba(245,158,11,.09);
    color:#92400e;
    border-radius:999px;
    padding:2px 7px;
    font-size:12px;
    line-height:1.3;
  }

  @media (max-width: 1100px){
    .synthese-kpis{
      grid-template-columns:repeat(3, minmax(140px, 1fr));
    }
    .synthese-filters{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 620px){
    .synthese-kpis,
    .synthese-filters{
      grid-template-columns:1fr;
    }
  }

  .providers-tabs{
    display:flex;
    gap:6px;
    align-items:center;
    flex-wrap:wrap;
    border-bottom:1px solid var(--border);
  }

  .users-tabs-head{
    align-items:flex-end;
  }

  .users-tabs{
    flex:1 1 auto;
    min-width:0;
  }

  .providers-tab{
    appearance:none;
    border:0;
    border-bottom:2px solid transparent;
    background:transparent;
    color:var(--muted);
    padding:10px 12px;
    font:inherit;
    font-weight:600;
    cursor:pointer;
  }

  .providers-tab:hover{
    color:var(--text);
    background:rgba(2,6,23,.03);
  }

  .providers-tab.is-active{
    color:var(--primary);
    border-bottom-color:var(--primary);
  }

  .providers-panel[hidden]{
    display:none;
  }

  .providers-table-wrap{
    width:100%;
    overflow:auto;
  }

  .providers-main-table{
    min-width:1040px;
  }

  .providers-view .sortable{
    cursor:pointer;
    user-select:none;
  }

  .providers-view .sortable.sort-asc::after{
    content:" \25B2";
    font-size:11px;
  }

  .providers-view .sortable.sort-desc::after{
    content:" \25BC";
    font-size:11px;
  }

  .modal-form,
  .providers-form{
    display:grid;
    grid-template-columns:repeat(4, minmax(160px, 1fr));
    gap:12px;
    align-items:end;
  }

  .modal-form label,
  .providers-form label{
    display:flex;
    flex-direction:column;
    gap:4px;
    font-size:13px;
    color:var(--muted);
  }

  .modal-form input,
  .modal-form select,
  .modal-form textarea,
  .providers-form input,
  .providers-form select,
  .providers-form textarea{
    width:100%;
  }

  .modal-form textarea,
  .providers-form textarea{
    resize:vertical;
  }

  .modal-form-actions{
    grid-column:1 / -1;
  }

  .providers-wide{
    grid-column:span 2;
  }

  .providers-modal-card{
    width:min(920px, 96vw);
    max-height:92vh;
    overflow:auto;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .providers-users-modal-card{
    width:min(1180px, 96vw);
  }

  .orders-create-modal-card{
    width:min(920px, 96vw);
  }

  .quote-create-form,
  .order-create-form{
    grid-template-columns:minmax(110px, .8fr) minmax(135px, 1fr) minmax(145px, 1fr) minmax(135px, 1fr) minmax(105px, .72fr) minmax(105px, .72fr);
  }

  .provider-create-form{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .provider-create-form .provider-detail-address,
  .provider-create-form .provider-detail-notes,
  .provider-create-form .provider-detail-actions{
    grid-column:1 / -1;
  }

  .provider-create-form select[name="type"][aria-readonly="true"]{
    pointer-events:none;
    color:var(--muted);
    background:rgba(148,163,184,.10);
  }

  .provider-user-modal-card{
    width:min(900px, 96vw);
  }

  .providers-provider-modal-card{
    width:min(1180px, 96vw);
  }

  .providers-provider-modal-card.is-provider-create{
    width:min(920px, 96vw);
  }

  .provider-detail-header-form{
    grid-template-columns:minmax(150px, 1.1fr) minmax(140px, .85fr) minmax(170px, 1fr) minmax(125px, .75fr) minmax(120px, .7fr) minmax(115px, .65fr) auto;
    gap:8px;
    align-items:end;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:10px 12px;
  }

  .provider-detail-header-form .provider-detail-address,
  .provider-detail-header-form .provider-detail-notes{
    grid-column:span 3;
  }

  .providers-provider-modal-card.is-provider-create .provider-detail-header-form{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .providers-provider-modal-card.is-provider-create .provider-detail-address,
  .providers-provider-modal-card.is-provider-create .provider-detail-notes,
  .providers-provider-modal-card.is-provider-create .provider-detail-actions{
    grid-column:1 / -1;
  }

  .providers-provider-modal-card.is-provider-create select[name="type"][aria-readonly="true"]{
    pointer-events:none;
    color:var(--muted);
    background:rgba(148,163,184,.10);
  }

  .providers-modal-actions.provider-detail-actions{
    grid-column:auto;
    justify-content:flex-end;
    flex-wrap:nowrap;
  }

  .provider-create-form .providers-modal-actions.provider-detail-actions{
    grid-column:1 / -1;
  }

  .provider-detail-nav{
    margin:-2px 0 0;
  }

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

  .providers-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
  }

  .providers-modal-head h3,
  .providers-modal-head p{
    margin:0;
  }

  .providers-modal-actions{
    grid-column:1 / -1;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
  }

  .devis-version-panel{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr)) auto;
    gap:12px;
    align-items:end;
  }

  .devis-version-link{
    min-width:0;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    padding:12px;
    display:flex;
    flex-direction:column;
    gap:4px;
  }

  .devis-version-link span{
    color:var(--muted);
    font-size:12px;
  }

  .devis-version-link strong{
    overflow-wrap:anywhere;
  }

  .devis-table td small{
    display:block;
    margin-top:3px;
  }

  .providers-article-tabs{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
    margin-bottom:-4px;
  }

  .providers-article-panel[hidden]{
    display:none;
  }

  .providers-detail-panel[hidden]{
    display:none;
  }

  .providers-detail-panel{
    min-width:0;
  }

  .providers-article-panel{
    min-height:420px;
    max-height:calc(92vh - 180px);
    overflow:auto;
  }

  .providers-article-panel .orders-section-head{
    position:sticky;
    top:0;
    z-index:2;
    background:var(--surface);
    padding-bottom:8px;
  }

  .providers-user-forms{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
  }

  .providers-user-form{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    align-items:end;
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px;
  }

  .providers-user-form-single{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .providers-user-form-single .providers-wide{
    grid-column:1 / -1;
  }

  .providers-contact-form{
    grid-template-columns:repeat(6, minmax(105px, 1fr));
    gap:8px 10px;
    padding:10px;
  }

  .providers-contact-form > label:first-of-type{
    grid-column:span 2;
  }

  .providers-contact-form .providers-lookup-actions{
    grid-column:3 / -1;
    min-height:34px;
  }

  .providers-contact-form .providers-lookup-result{
    grid-column:1 / -1;
    padding:8px 10px;
  }

  .providers-contact-form label{
    gap:2px;
    font-size:12px;
    min-width:0;
  }

  .providers-contact-form .providers-form-title{
    font-size:14px;
  }

  .providers-contact-form .providers-check{
    min-height:34px;
  }

  .providers-contact-form .providers-modal-actions{
    grid-column:3 / -1;
  }

  .client-tariff-grid-toolbar{
    display:grid;
    grid-template-columns:minmax(220px, .8fr) minmax(260px, 1.4fr) auto;
    gap:10px;
    align-items:end;
    padding:10px 12px;
    margin-bottom:10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
  }

  .client-tariff-grid-toolbar label{
    display:grid;
    gap:4px;
    font-size:12px;
  }

  .client-tariff-grid-meta{
    min-height:36px;
    display:flex;
    align-items:center;
    color:var(--muted);
    font-size:13px;
  }

  .client-tariff-grid-meta[data-status="active"]{
    color:#15803d;
  }

  @media (max-width: 860px){
    .client-tariff-grid-toolbar{
      grid-template-columns:1fr;
      align-items:stretch;
    }
  }

  .client-tarifs-table{
    table-layout:fixed;
    min-width:820px;
  }

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

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

  .client-tarifs-table th:nth-child(4),
  .client-tarifs-table td:nth-child(4){
    width:130px;
  }

  .client-tarifs-table th:nth-child(5),
  .client-tarifs-table td:nth-child(5){
    width:95px;
  }

  .client-tarifs-table th:nth-child(6),
  .client-tarifs-table td:nth-child(6){
    width:112px;
  }

  .client-tarifs-table td:nth-child(1),
  .client-tarifs-table td:nth-child(2){
    overflow-wrap:anywhere;
  }

  .providers-lookup-actions{
    display:flex;
    align-items:flex-end;
    min-height:42px;
  }

  .providers-lookup-result{
    border:1px solid var(--border);
    border-radius:8px;
    padding:10px 12px;
    background:rgba(2,6,23,.03);
    color:var(--text);
  }

  .providers-lookup-result.is-success{
    border-color:rgba(22,163,74,.35);
    background:rgba(22,163,74,.08);
    color:#15803d;
  }

  .providers-lookup-result.is-warning{
    border-color:rgba(220,38,38,.35);
    background:rgba(220,38,38,.08);
    color:#b91c1c;
  }

  .providers-result-list{
    grid-column:1 / -1;
    display:flex;
    flex-direction:column;
    gap:6px;
    max-height:260px;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:8px;
    padding:8px;
    background:var(--surface);
  }

  .providers-result-list[hidden]{
    display:none;
  }

  .providers-result-row{
    width:100%;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    padding:8px 10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    text-align:left;
    cursor:pointer;
  }

  .providers-result-row:hover{
    background:rgba(2,6,23,.04);
  }

  .providers-result-row small{
    color:var(--muted);
    white-space:nowrap;
  }

  .providers-form-title{
    grid-column:1 / -1;
    margin:0;
    font-size:15px;
  }

  .providers-check{
    flex-direction:row;
    align-items:center;
    gap:8px;
    color:var(--text);
    min-height:42px;
  }

  .providers-check input[type="checkbox"]{
    width:auto;
    min-width:16px;
    padding:0;
    margin:0;
  }

  .providers-row-actions{
    display:flex;
    gap:6px;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:nowrap;
  }

  .providers-icon-btn{
    width:32px;
    height:32px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:8px;
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
    box-shadow:none;
  }

  .providers-icon-btn:hover{
    background:rgba(2,6,23,.04);
  }

  .providers-icon-btn.warning{
    border-color:#f59e0b;
    color:#b45309;
  }

  .providers-icon-btn.invite{
    border-color:#16a34a;
    color:#15803d;
  }

  .providers-icon-btn.access-message--pending{
    color:#b45309;
    border-color:#d97706;
  }

  .providers-icon-btn.access-message--sent{
    color:#15803d;
    border-color:#16a34a;
  }

  @media (prefers-color-scheme:dark){
    .providers-icon-btn.access-message--pending{color:#fbbf24;}
    .providers-icon-btn.access-message--sent{color:#4ade80;}
  }

  .providers-icon-btn.danger{
    border-color:#dc2626;
    color:#dc2626;
  }

  .providers-icon-btn svg{
    width:17px;
    height:17px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

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

  .providers-table th:last-child,
  .providers-table td:last-child{
    text-align:right;
    white-space:nowrap;
  }

  @media (max-width: 900px){
    .providers-form{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .provider-detail-header-form{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .provider-detail-header-form .provider-detail-address,
    .provider-detail-header-form .provider-detail-notes,
    .providers-modal-actions.provider-detail-actions{
      grid-column:1 / -1;
    }
    .providers-user-forms{
      grid-template-columns:1fr;
    }
    .providers-user-form-single{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .providers-contact-form{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .providers-contact-form > label:first-of-type,
    .providers-contact-form .providers-lookup-actions,
    .providers-contact-form .providers-modal-actions{
      grid-column:1 / -1;
    }
  }

  @media (max-width: 620px){
    .providers-form{
      grid-template-columns:1fr;
    }
    .provider-detail-header-form{
      grid-template-columns:1fr;
    }
    .providers-user-form-single{
      grid-template-columns:1fr;
    }
    .providers-contact-form{
      grid-template-columns:1fr;
    }
    .providers-contact-form > label:first-of-type,
    .providers-contact-form .providers-lookup-actions,
    .providers-contact-form .providers-modal-actions{
      grid-column:1 / -1;
    }
    .providers-wide{
      grid-column:auto;
    }
    .providers-modal-actions .btn{
      width:100%;
    }
    .providers-modal-actions{
      justify-content:stretch;
    }
  }

  .app-brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
  }

  .active-organization{
    color:var(--muted);
    font-size:13px;
    padding-left:10px;
    border-left:1px solid var(--border);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .user-menu-organization{
    display:grid;
    gap:4px;
    margin-top:8px;
    color:var(--muted);
    font-size:12px;
  }

  .user-menu-organization select{
    width:100%;
    min-height:34px;
  }

  .organizations-tabs{
    justify-content:space-between;
  }

  .organizations-tabs .providers-tab-actions{
    margin-left:auto;
  }

  .organizations-status{
    margin:10px 0;
  }

  .organizations-status:empty{ display:none; }

  .organizations-status.is-error{ color:#dc2626; }
  .organizations-status.is-success{ color:#15803d; }
  .organizations-table tr.is-inactive{ opacity:.62; }

  .organizations-table .organization-open-column{
    width:48px;
    min-width:48px;
    text-align:center;
  }

  .organizations-table .organization-open-column .action-icon-btn{
    margin-inline:auto;
  }

  .organizations-modal-card{
    width:min(920px, 96vw);
  }

  .organization-profile-form{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    max-height:min(72vh, 720px);
    overflow-y:auto;
    padding-right:4px;
  }

  .organization-span-all,
  .organization-form-section-title{
    grid-column:1 / -1;
  }

  .organization-form-section-title{
    padding-bottom:6px;
    border-bottom:1px solid var(--border);
    color:var(--text);
    font-size:14px;
    font-weight:700;
  }

  .organization-detail-modal-card{
    width:min(1180px, 96vw);
    max-height:94vh;
    overflow:auto;
  }

  .organization-detail-header-form{
    grid-template-columns:repeat(4, minmax(150px, 1fr));
  }

  .organization-name-field{
    grid-column:span 3;
  }

  .organization-billing-email-field{
    grid-column:span 2;
  }

  .organization-detail-status{
    grid-column:1 / span 3;
    min-height:34px;
    align-self:center;
  }

  .organization-detail-actions{
    grid-column:4;
    justify-content:flex-end;
  }

  .organization-detail-nav{
    grid-column:1 / -1;
    margin-top:16px;
  }

  .organization-detail-nav-actions{
    display:flex;
    align-items:center;
    margin-left:auto;
  }

  .organization-detail-nav-actions > [hidden]{
    display:none;
  }

  .organization-detail-section{
    grid-column:1 / -1;
    min-width:0;
  }

  .organization-detail-section[hidden]{
    display:none;
  }

  .organization-detail-fields-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(150px, 1fr));
    gap:12px;
  }

  .organization-legal-fields{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }

  .organization-representative-email-field{
    grid-column:span 2;
  }

  .organization-stat-grid{
    display:grid;
    grid-template-columns:repeat(7, minmax(110px, 1fr));
    gap:10px;
  }

  .organization-stat{
    display:flex;
    min-height:74px;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:6px;
    background:var(--surface);
  }

  .organization-stat strong{
    color:var(--text);
    font-size:20px;
  }

  .organization-stat span{
    color:var(--muted);
    font-size:12px;
  }

  .organization-invoices-table{
    min-width:860px;
  }

  .organization-members-table{
    min-width:960px;
  }

  .organization-members-table tr.is-inactive,
  .organization-members-table tr.is-removed{
    opacity:.62;
  }

  .organization-members-table tr.is-removed td:not(:last-child){
    text-decoration:line-through;
  }

  .organization-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
  }

  .organization-section-head h4{
    margin:0;
  }

  .organization-account-form{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .organization-account-email{
    grid-column:1 / -1;
  }

  .organizations-access-table{
    min-width:980px;
  }

  .organizations-table .directory-filter-row th{
    padding-top:8px;
    padding-bottom:8px;
    background:var(--surface);
  }

  .organizations-table .directory-filter-row input{
    width:100%;
    min-width:110px;
    height:34px;
    padding:6px 9px;
    font-size:12px;
  }

  .organization-invoices-table,
  .organization-documents-table{
    min-width:960px;
  }

  .organization-profile-form textarea,
  .organization-account-form textarea{
    width:100%;
    resize:vertical;
  }

  @media (max-width:720px){
    .active-organization{ display:none; }
    .organization-profile-form,
    .organization-detail-header-form,
    .organization-detail-fields-grid,
    .organization-account-form{ grid-template-columns:1fr; }
    .organization-profile-form > *,
    .organization-detail-header-form > *,
    .organization-account-form > *{ grid-column:1; }
    .organization-detail-nav-actions{ width:100%; margin-left:0; }
    .organization-stat-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  }

  .directory-view{
    min-width:0;
  }

  .directory-head{
    align-items:flex-end;
  }

  .directory-tabs{
    flex:1 1 auto;
    min-width:0;
  }

  .directory-panel{
    min-width:0;
  }

  .directory-panel[hidden]{
    display:none;
  }

  .directory-table-wrap{
    width:100%;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
  }

  .directory-table{
    min-width:860px;
    margin:0;
  }

  .directory-team-table{
    min-width:1120px;
  }

  .directory-team-filters input{
    min-width:110px;
  }

  .directory-access-table{
    min-width:1120px;
  }

  .directory-access-filters input,
  .directory-access-filters select{
    min-width:110px;
    width:100%;
  }

  .directory-contacts-table{
    min-width:820px;
    table-layout:fixed;
  }

  .directory-contacts-table th:nth-child(1){width:13%;}
  .directory-contacts-table th:nth-child(2){width:12%;}
  .directory-contacts-table th:nth-child(3){width:19%;}
  .directory-contacts-table th:nth-child(5){width:124px;}
  .directory-contacts-table th:nth-child(6){width:170px;}

  .directory-contacts-table td{
    overflow-wrap:anywhere;
  }

  .directory-contacts-table .providers-icon-btn{
    flex:0 0 32px;
  }

  .directory-sort-button{
    display:inline-flex;
    align-items:center;
    gap:6px;
    max-width:100%;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    color:inherit;
    font:inherit;
    text-transform:inherit;
    text-align:left;
    letter-spacing:0;
    cursor:pointer;
  }

  .directory-sort-button::after{
    content:"\2195";
    flex:none;
    opacity:.5;
  }

  th[aria-sort="ascending"] .directory-sort-button::after{content:"\25b2";opacity:1;}
  th[aria-sort="descending"] .directory-sort-button::after{content:"\25bc";opacity:1;}

  .directory-sort-button:focus-visible{
    outline:2px solid var(--primary);
    outline-offset:4px;
  }

  .directory-contact-filters input,
  .directory-contact-filters select,
  .directory-grid-filters input{
    min-width:0;
    width:100%;
  }

  .directory-grid-filters input{
    min-width:90px;
  }

  .directory-disabled-action{
    display:inline-flex;
    flex:0 0 32px;
    cursor:not-allowed;
  }

  .directory-disabled-action button:disabled{
    pointer-events:none;
    opacity:.45;
  }

  .directory-parties-table{
    min-width:1080px;
  }

  .directory-party-filters input{
    min-width:110px;
  }

  .directory-detail-header-form{
    padding-bottom:14px;
    border-bottom:1px solid var(--border);
  }

  .directory-detail-nav-actions{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    margin-left:auto;
  }

  .directory-detail-nav-actions > [hidden]{
    display:none;
  }

  .directory-business-description{
    margin:0;
    padding:14px 2px;
  }

  .directory-business-description:empty{
    display:none;
  }

  .directory-business-table{
    min-width:920px;
  }

  .directory-articles-card{
    width:min(1180px, 96vw);
    max-height:92vh;
    overflow:hidden;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .directory-articles-nav{
    flex:0 0 auto;
  }

  .directory-articles-table-wrap{
    max-height:min(58vh, 620px);
    overflow:auto;
  }

  .directory-articles-table-wrap .directory-table{
    min-width:900px;
  }

  .directory-table tr.is-inactive{
    opacity:.58;
  }

  .directory-table tr.is-removed{
    opacity:.5;
    background:rgba(148,163,184,.08);
  }

  .directory-table tr.is-removed td:not(:last-child){
    color:var(--muted);
    text-decoration:line-through;
  }

  .directory-form label{
    display:flex;
    flex-direction:column;
    gap:4px;
    color:var(--muted);
    font-size:13px;
  }

  .directory-form input,
  .directory-form select,
  .directory-form textarea{
    width:100%;
  }

  .directory-combobox{
    position:relative;
    display:block;
    width:100%;
  }

  .directory-combobox > input{
    padding-right:38px;
  }

  .directory-combobox-toggle{
    position:absolute;
    top:1px;
    right:1px;
    width:36px;
    height:calc(100% - 2px);
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-left:1px solid var(--border);
    border-radius:0 7px 7px 0;
    background:transparent;
    color:var(--muted);
    cursor:pointer;
  }

  .directory-combobox-toggle:hover,
  .directory-combobox-toggle:focus-visible{
    color:var(--text);
    background:rgba(148,163,184,.10);
  }

  .directory-combobox-toggle svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .directory-combobox-menu{
    position:absolute;
    z-index:30;
    top:calc(100% + 4px);
    left:0;
    right:0;
    max-height:220px;
    overflow:auto;
    padding:4px;
    border:1px solid var(--border);
    border-radius:7px;
    background:var(--surface);
    box-shadow:0 14px 32px rgba(15,23,42,.18);
  }

  .directory-combobox-menu[hidden]{
    display:none;
  }

  .directory-combobox-option{
    width:100%;
    padding:8px 10px;
    border:0;
    border-radius:5px;
    background:transparent;
    color:var(--text);
    text-align:left;
    cursor:pointer;
  }

  .directory-combobox-option:hover,
  .directory-combobox-option:focus-visible{
    background:rgba(59,130,246,.12);
  }

  .directory-combobox-empty{
    display:block;
    padding:8px 10px;
    color:var(--muted);
  }

  .directory-form-card{
    width:min(920px, 96vw);
    max-height:92vh;
    overflow:auto;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .directory-picker-card #directoryPatrimoineForm{
    grid-template-columns:minmax(0, 1fr) auto;
  }

  .directory-picker-card #directoryPatrimoineCount{
    margin-right:auto;
  }

  .directory-picker-search-actions{
    justify-content:flex-end;
  }

  .directory-tariff-toolbar{
    margin-top:2px;
    grid-template-columns:minmax(0, 1fr) auto;
  }

  .directory-tariff-toolbar .client-tariff-grid-meta{ grid-column:1; }
  .directory-tariff-toolbar > .providers-row-actions{ grid-column:2; grid-row:1 / 3; }
  .directory-form.directory-tariff-form{ grid-template-columns:minmax(100px, .7fr) minmax(0, 1.2fr) minmax(140px, .8fr); }
  .directory-form.directory-version-form{ grid-template-columns:minmax(0, 2fr) minmax(150px, 1fr); }
  .directory-version-form .providers-check{ display:flex; text-align:left; }
  .directory-tariff-form textarea{ font:inherit; }
  .directory-tariff-review-table{ min-width:700px; }
  .directory-tariff-review-table .num{ text-align:right; white-space:nowrap; }
  #modalDirectoryTariffReview .modal-form-actions{ display:flex; justify-content:flex-end; gap:8px; }

  @media (max-width:800px){
    .directory-tariff-toolbar{ grid-template-columns:minmax(0, 1fr); }
    .directory-tariff-toolbar > .providers-row-actions{ grid-column:1; grid-row:auto; flex-wrap:wrap; }
  }

  .directory-detail-card{
    width:min(1180px, 96vw);
    max-height:92vh;
    overflow:auto;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .directory-feedback-card{
    width:min(500px, 96vw);
  }

  .directory-form{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:12px;
    align-items:end;
  }

  .directory-span-2{
    grid-column:span 2;
  }

  .directory-span-all{
    grid-column:1 / -1;
  }

  .directory-form .modal-form-actions{
    grid-column:1 / -1;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:8px;
  }

  .directory-detail-panel[hidden]{
    display:none;
  }

  .directory-notes-panel{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding-top:2px;
  }

  .directory-notes-panel label{
    display:flex;
    flex-direction:column;
    gap:4px;
    color:var(--muted);
    font-size:13px;
  }

  .directory-notes-panel textarea{
    width:100%;
    min-height:140px;
    resize:vertical;
  }

  .directory-detail-footer{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:12px;
    padding-top:12px;
    border-top:1px solid var(--border);
  }

  .directory-detail-footer .login-msg{
    flex:1;
    margin:0;
  }

  .directory-stacked-cell{
    display:flex;
    flex-direction:column;
    gap:2px;
    line-height:1.35;
  }

  .directory-access-sources-card{
    width:min(620px, 92vw);
  }

  .directory-access-sources-list{
    display:grid;
    gap:8px;
    margin-top:14px;
  }

  .directory-access-source-option{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    width:100%;
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--text);
    text-align:left;
    cursor:pointer;
  }

  .directory-access-source-option:hover{
    border-color:var(--primary);
    background:rgba(59,130,246,.08);
  }

  .directory-access-source-option span{
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
  }

  .directory-feedback-content{
    display:grid;
    grid-template-columns:40px minmax(0, 1fr);
    gap:12px;
    align-items:start;
  }

  .directory-feedback-icon{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:8px;
    background:rgba(59,130,246,.10);
    color:var(--primary);
  }

  .directory-feedback-icon svg{
    width:21px;
    height:21px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .directory-feedback-content h3,
  .directory-feedback-content p{
    margin:0;
  }

  .directory-feedback-content p{
    margin-top:6px;
    color:var(--muted);
    white-space:pre-line;
  }

  @media (max-width:800px){
    .directory-form{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .directory-span-all{
      grid-column:1 / -1;
    }
    .directory-detail-nav-actions{
      width:100%;
      margin-left:0;
    }
  }

  @media (max-width:560px){
    .directory-form.directory-tariff-form,
    .directory-form.directory-version-form{ grid-template-columns:minmax(0, 1fr); }
    .directory-head{
      align-items:stretch;
      flex-direction:column;
    }
    .directory-form{
      grid-template-columns:1fr;
    }
    .directory-picker-card #directoryPatrimoineForm{
      grid-template-columns:1fr;
    }
    .directory-span-2,
    .directory-span-all{
      grid-column:1;
    }
    .directory-form .modal-form-actions .btn{
      flex:1 1 0;
    }
  }
