/* ═══════════════════════════════════════════════════════════════
   HIDS-GED — DESIGN SYSTEM HOLOGRAM.CD
   Thèmes : Sombre (dark) et Clair (light)
   Développé par Hologram
   ═══════════════════════════════════════════════════════════════ */

/* ── THÈME SOMBRE (défaut) ─────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg-primary:       #0D1117;
  --bg-base:          #0D1117;
  --bg-card:          #161B22;
  --bg-sidebar:       #0D1117;
  --bg-hover:         #1C2128;
  --bg-input:         #1C2128;
  --bg-header:        #161B22;
  --accent-primary:   #1E6FBF;
  --accent-dark:      #003366;
  --accent-hover:     #2563EB;
  --accent-light:     #3B82F6;
  --text-primary:     #E6EDF3;
  --text-secondary:   #8B949E;
  --text-muted:       #484F58;
  --text-link:        #58A6FF;
  --border:           #30363D;
  --border-subtle:    #21262D;
  --success:          #3FB950;
  --warning:          #D29922;
  --danger:           #F85149;
  --info:             #58A6FF;
  --sidebar-width:    260px;
  --header-height:    60px;
  --radius:           6px;
  --radius-lg:        10px;
  --shadow:           0 4px 16px rgba(0,0,0,0.4);
  --transition:       all 0.15s ease;
  color-scheme: dark;
}

/* ── THÈME CLAIR ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:       #F6F8FA;
  --bg-base:          #F6F8FA;
  --bg-card:          #FFFFFF;
  --bg-sidebar:       #F0F2F5;
  --bg-hover:         #EAECEF;
  --bg-input:         #FFFFFF;
  --bg-header:        #FFFFFF;
  --accent-primary:   #1A6FBF;
  --accent-dark:      #0D4E8A;
  --accent-hover:     #1557A0;
  --accent-light:     #2563EB;
  --text-primary:     #1A1D21;
  --text-secondary:   #57606A;
  --text-muted:       #8C959F;
  --text-link:        #0969DA;
  --border:           #D0D7DE;
  --border-subtle:    #EAECEF;
  --success:          #1A7F37;
  --warning:          #9A6700;
  --danger:           #CF222E;
  --info:             #0969DA;
  --shadow:           0 4px 16px rgba(0,0,0,0.12);
  color-scheme: light;
}

/* Inputs date/time coherents avec le theme */
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
  color-scheme: light !important;
}

/* Transition fluide lors du changement de theme */
html { transition: background-color 0.2s ease, color 0.2s ease; }

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif !important;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

.hids-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.hids-header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  gap: 16px;
}

.hids-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  flex-shrink: 0;
  min-width: calc(var(--sidebar-width) - 32px);
}

.hids-logo {
  height: 38px;
  width: auto;
  max-width: 148px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
}

.hids-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hids-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hids-brand-emoji,
.hids-brand-icon {
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.95;
  color: var(--accent-primary);
}

.hids-brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.hids-search { flex: 1; max-width: 480px; }

.hids-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hids-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.hids-search-input {
  width: 100%;
  background: var(--bg-hover) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  color: var(--text-primary) !important;
  padding: 7px 16px 7px 36px !important;
  font-size: 13px !important;
  outline: none;
  transition: var(--transition);
}

.hids-search-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px rgba(30,111,191,0.2) !important;
}

.hids-search-input::placeholder { color: var(--text-muted) !important; }

.hids-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hids-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.hids-user-btn:hover,
.hids-user-btn.active {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.hids-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hids-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.hids-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.hids-user-info { display: flex; flex-direction: column; line-height: 1.2; }

.hids-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 1100;
  overflow: hidden;
}

.hids-user-menu { position: relative; }

.hids-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  font-size: 13px;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
}

.hids-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary) !important;
}

.hids-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.hids-dropdown-logout { color: var(--danger) !important; }
.hids-dropdown-logout:hover { background: rgba(248,81,73,0.1); }

.hids-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.hids-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  z-index: 900;
}

.hids-sidebar-inner { flex: 1; padding: 12px 8px; }

.hids-nav-section { margin-bottom: 20px; }

.hids-nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 4px 8px 6px;
}

.hids-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 1px;
  position: relative;
}

.hids-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary) !important;
}

.hids-nav-item.active {
  background: rgba(30,111,191,0.15);
  color: var(--accent-light) !important;
  font-weight: 600;
}

.hids-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}

.hids-nav-item i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

/* Libellé flexible ; pastilles / badges alignés sur le bord droit de la sidebar */
.hids-nav-item > i + span:not(.hids-badge):not(.hids-wf-indicators),
.hids-nav-item > .hids-nav-workflows-label {
  flex: 1;
  min-width: 0;
}

.hids-nav-item > .hids-badge,
.hids-nav-item > .hids-wf-indicators {
  margin-left: auto;
  flex-shrink: 0;
}

.hids-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}

.hids-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.hids-sidebar-user-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.hids-sidebar-user-role {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.hids-sidebar-toggle {
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 10px;
  cursor: pointer;
  display: none;
}

.hids-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 890;
}

.hids-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-base);
}

#ajax-content,
.hids-content {
  min-width: 0;
  max-width: 100%;
  background: var(--bg-base) !important;
  color: var(--text-primary) !important;
}

.hids-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.hids-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  margin: 0;
}

.hids-greeting-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Badge vérifié — style Meta/Instagram (SVG, pas d’icône patch emoji) */
.hids-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 0;
}

.hids-verified-badge-svg {
  display: block;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(24, 119, 242, 0.35));
}

.hids-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 3px 0 0;
}

.hids-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hids-breadcrumb a { color: var(--text-link) !important; text-decoration: none !important; }
.hids-breadcrumb a:hover { color: var(--accent-light) !important; }
.hids-breadcrumb-sep { color: var(--text-muted); }

.hids-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.hids-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.hids-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.hids-card-body { padding: 20px; }

.hids-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hids-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Recherche mobile : masqué desktop (overlay activé ≤767px) */
.hids-search-mobile-toggle,
.hids-search-overlay { display: none; }

/* Contrôles zoom PDF — visible sur tous les écrans */
.hids-pdf-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#hidsPdfViewerWrap {
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  background: #1a1a2e !important;
}

#hidsPdfViewerWrap.hids-pdf-viewer-wrap--zoomed {
  overflow: auto;
  max-height: min(78vh, 920px);
  background: #1a1a2e !important;
}

#hidsPdfZoomStage {
  width: 100%;
  box-sizing: border-box;
}

#hidsPdfZoomLayer {
  display: block;
  position: relative;
  vertical-align: top;
  flex-shrink: 0;
  margin: 0;
}

#hidsPdfCanvas {
  max-width: none !important;
  height: auto !important;
}

.hids-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary) !important;
}

.hids-table thead th {
  background: var(--bg-card);
  color: var(--text-secondary) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.hids-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary) !important;
  font-size: 13px;
}

.hids-table tbody tr:hover td { background: var(--bg-hover); }
.hids-table tbody tr:last-child td { border-bottom: none; }

.hids-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.hids-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff !important;
}
.hids-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff !important; }

.hids-btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary) !important;
}
.hids-btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent-light); }

.hids-btn-success { background: var(--success); border-color: var(--success); color: #fff !important; }
.hids-btn-success:hover { background: #2ea043; }

.hids-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff !important; }
.hids-btn-danger:hover { background: #da3633; }

.hids-btn-warning { background: var(--warning); border-color: var(--warning); color: #fff !important; }

.hids-btn-sm { padding: 4px 10px; font-size: 12px; }
.hids-btn-lg { padding: 10px 24px; font-size: 15px; }
.hids-btn-full { width: 100%; justify-content: center; }

.hids-btn-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.hids-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hids-input,
.hids-select,
.hids-textarea {
  display: block;
  width: 100%;
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  transition: var(--transition);
  outline: none;
}

.hids-input:focus,
.hids-select:focus,
.hids-textarea:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(30,111,191,0.2) !important;
}

.hids-input::placeholder,
.hids-textarea::placeholder { color: var(--text-muted) !important; }

input[type="date"],
input[type="datetime-local"] {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  color-scheme: dark !important;
  width: 100%;
  outline: none;
}

input[type="date"]:focus,
input[type="datetime-local"]:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(30,111,191,0.2) !important;
}

.hids-input-group { position: relative; display: flex; }
.hids-input-group .hids-input { border-radius: var(--radius) 0 0 var(--radius) !important; }
.hids-input-toggle {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  padding: 0 12px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.hids-messages { margin-bottom: 20px; }

.hids-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  border-left: 3px solid;
}

.hids-alert-content { display: flex; align-items: center; gap: 8px; }
.hids-alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; opacity: 0.6; padding: 0; }
.hids-alert-close:hover { opacity: 1; }

.hids-alert-success { background: rgba(63,185,80,0.1); color: var(--success); border-color: var(--success); }
.hids-alert-error,
.hids-alert-danger  { background: rgba(248,81,73,0.1); color: var(--danger); border-color: var(--danger); }
.hids-alert-warning { background: rgba(210,153,34,0.1); color: var(--warning); border-color: var(--warning); }
.hids-alert-info    { background: rgba(88,166,255,0.1); color: var(--info); border-color: var(--info); }

.hids-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.hids-badge-primary { background: rgba(30,111,191,0.2); color: var(--accent-light); }
.hids-badge-success { background: rgba(63,185,80,0.2); color: var(--success); }
.hids-badge-danger  { background: rgba(248,81,73,0.2); color: var(--danger); }
.hids-badge-warning { background: rgba(210,153,34,0.2); color: var(--warning); }
.hids-badge-muted   { background: var(--bg-hover); color: var(--text-muted); }

.hids-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  gap: 4px;
}

.hids-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hids-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

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

.hids-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.hids-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.hids-modal-body { padding: 20px; }

.hids-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.hids-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  justify-content: center;
}

.hids-page-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-link) !important;
  text-decoration: none !important;
  font-size: 13px;
  transition: var(--transition);
}

.hids-page-btn:hover { background: var(--bg-hover); border-color: var(--accent-light); }
.hids-page-btn.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff !important; }
.hids-page-btn.disabled { opacity: 0.4; pointer-events: none; }

.hids-signature-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 2px solid var(--accent-primary);
  padding: 20px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  z-index: 1050;
  max-height: 65vh;
  overflow-y: auto;
}

.hids-login-body {
  background: var(--bg-base) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.hids-login-container {
  width: 100%;
  max-width: 420px;
}

.hids-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.hids-login-header {
  text-align: center;
  padding: 32px 24px 24px;
  background: linear-gradient(135deg, var(--accent-dark) 0%, #0D2748 100%);
  border-bottom: 1px solid var(--border);
}

.hids-login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.hids-login-logo {
  height: 72px;
  width: 72px;
  max-width: none;
  object-fit: contain;
  display: block;
  margin: 0;
}

.hids-login-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0 0 4px; }
.hids-login-subtitle { font-size: 12px; color: rgba(255,255,255,0.65); margin: 0 0 4px; }
.hids-login-company { font-size: 11px; color: rgba(255,255,255,0.45); margin: 0; text-transform: uppercase; letter-spacing: 0.1em; }

.hids-login-form { padding: 24px; }
.hids-login-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); text-align: center; color: var(--text-muted); }

.hids-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.hids-empty-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.hids-empty-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.hids-empty-desc { font-size: 13px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (max-width: 1200px) {
  :root { --sidebar-width: 220px; }
}

@media (max-width: 768px) {
  /* Aligné contrat tests intégraux (complète la règle 767px ci-dessous) */
  .hids-main { padding: 16px; }
}

@media (max-width: 991px) {
  .hids-brand-sub { display: none; }
  .hids-user-info { display: none; }
}

.dashboard-archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}


@media (max-width: 767px) {
  html { overflow-x: clip; }

  /* ── Toggle hamburger ── */
  .hids-sidebar-toggle {
    display: flex;
    padding: 5px 9px;
    min-width: 38px;
    min-height: 38px;
  }

  /* ── Sidebar : slide depuis la gauche (sous le header fixe) ── */
  .hids-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    z-index: 900;
    transform: translateX(calc(-1 * var(--sidebar-width) - 10px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
  }
  .hids-sidebar.open { transform: translateX(0); }
  .hids-sidebar-overlay.open { display: block; }
  .hids-sidebar-inner { overflow-y: auto; flex: 1; }

  /* ── Main content : pleine largeur (scroll local par zone, pas page entière) ── */
  .hids-main {
    margin-left: 0;
    padding: 14px;
    max-width: 100%;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Header : compact sur mobile ── */
  .hids-header-inner {
    gap: 6px;
    padding: 0 10px;
  }
  .hids-search { display: none; }
  .hids-brand { min-width: 0; }
  .hids-brand-text { display: none; }
  .hids-logo {
    height: 32px;
    width: 32px;
  }

  /* Thème via profil (masqué pour libérer la barre) */
  #hids-theme-toggle { display: none; }

  /* ── Tables : scroll horizontal, toutes colonnes visibles ── */
  .hids-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hids-table-wrap:not(.hids-table-wrap--fluid) > .hids-table:not(.hids-price-matrix-table) {
    min-width: max(100%, 640px);
  }
  .hids-table-wrap--fluid > .hids-table {
    min-width: 0;
    width: 100%;
  }
  .hids-price-matrix-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hids-price-matrix-table-wrap > .hids-price-matrix-table {
    min-width: max(100%, 480px);
  }

  /* Touch targets accessibles (iOS / Android) */
  .hids-btn,
  .hids-nav-item,
  .hids-sidebar-toggle {
    min-height: 44px;
  }

  /* Safe area iOS modales */
  .hids-modal-overlay {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Sidebar premium calme en drawer — libellé complet, pastilles en dessous */
  .hids-nav-workflows-premium {
    animation: none;
    background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 4px;
  }
  .hids-nav-workflows-premium .hids-nav-workflows-label {
    animation: none;
    flex: 1 1 calc(100% - 28px);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    line-height: 1.25;
  }
  .hids-nav-workflows-premium .hids-wf-indicators {
    flex: 1 1 100%;
    margin-left: 28px;
    justify-content: flex-start;
  }
  .hids-wf-dot {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
  }

  /* Indicateur scroll horizontal (AW, filtres, etc.) */
  .hids-scroll-x--hint {
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 16px,
      #000 calc(100% - 16px),
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 16px,
      #000 calc(100% - 16px),
      transparent 100%
    );
  }

  /* Créer / téléverser — zone upload tactile + scroll picker */
  .hids-file-upload {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-hover);
  }
  .hids-file-upload .hids-input[type="file"],
  .hids-file-upload input[type="file"] {
    width: 100%;
    min-height: 44px;
  }
  .hids-dest-list {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hids-om-site-toggle {
    min-height: 44px;
  }

  /* Recherche mobile (overlay — header desktop inchangé) */
  .hids-search-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 6px);
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
  }
  .hids-search-overlay.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: flex-start;
    justify-content: center;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
  }
  .hids-search-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
  }
  .hids-search-overlay-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }
  .hids-search-overlay-form {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .hids-search-overlay-form .hids-search-wrap { flex: 1; max-width: none; }
  .hids-search-overlay-close {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
  }

  /* PDF zoom mobile — scroll uniquement hors zoom 100 % */
  #hidsPdfViewerWrap.hids-pdf-viewer-wrap--zoomed {
    max-height: min(62vh, 720px);
  }

  /* ── Boutons ── */
  .hids-btn-actions { flex-direction: column; gap: 8px; }
  .hids-btn-full-mobile { width: 100%; justify-content: center; }
  .hids-page-header { flex-direction: column; align-items: stretch; }
  .hids-page-header .hids-btn { width: 100%; justify-content: center; }

  /* ── Modale formulaire : plein écran sur mobile ── */
  .hids-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .hids-modal {
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    width: 100%;
    overflow-y: auto;
  }
  .hids-modal-body { padding: 16px; }
  .hids-modal-header { padding: 14px 16px; position: sticky; top: 0; background: var(--bg-card); z-index: 2; }

  /* ── Signature panel ── */
  .hids-signature-panel { max-height: 85vh; overflow-y: auto; }

  /* ── Grilles ── */
  .dashboard-archive-grid { grid-template-columns: 1fr; }

  /* ── Document detail : tabs en scroll horizontal ── */
  .hids-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .hids-tab { white-space: nowrap; }

  /* ── PDF viewer : hauteur adaptée ── */
  .hids-pdf-iframe { min-height: 60vh; height: 60vh; }

  /* ── Cartes info ── */
  .hids-card-body { padding: 14px; }
  .hids-form-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  /* Masquer l'avatar utilisateur texte, garder juste l'icône */
  .hids-user-btn .bi-chevron-down { display: none; }
  .hids-user-info { display: none !important; }
  .hids-avatar { width: 32px; height: 32px; font-size: 12px; }

  /* Notification badge compact */
  .hids-notif-btn { padding: 4px 6px; }
}

@media (max-width: 375px) {
  body { font-size: 13px; }
  .hids-main { padding: 10px; }
  .hids-card-body { padding: 12px; }
}

.hids-divider { height: 1px; background: var(--border); margin: 16px 0; }
a:not(.hids-btn):not(.hids-nav-item):not(.hids-dropdown-item):not(.hids-page-btn) { color: var(--text-link); }
.hids-nav-item,
.hids-dropdown-item { color: var(--text-secondary); }
h1,h2,h3,h4,h5,h6 { color: var(--text-primary) !important; }
.text-muted { color: var(--text-secondary) !important; }
hr { border-color: var(--border) !important; }

/* Anciennes classes page login (compat.) */
body.hids-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
}
.hids-plain-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.hids-notif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none !important;
  transition: var(--transition);
}
.hids-notif-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.rotate-180 { transform: rotate(180deg); }
.transition { transition: var(--transition); }

/* Onglets fiche document */
.hids-tab, .hids-tab-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.hids-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.hids-tab-active {
  color: var(--accent-light);
  border-bottom-color: var(--accent-primary);
  background: var(--bg-hover);
}

/* ── Tableau prix (Mémo achat test) ─────────────────────────────────────── */
.hids-price-matrix {
  margin-top: 4px;
}

.hids-price-matrix-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius);
}

.hids-price-matrix-intro i {
  color: var(--accent-light);
  font-size: 15px;
  margin-top: 1px;
  flex-shrink: 0;
}

.hids-price-matrix-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.hids-price-matrix-table {
  margin: 0;
}

.hids-price-matrix-table thead th {
  background: var(--bg-hover);
}

.hids-price-matrix-th-idx {
  width: 48px;
  text-align: center !important;
}

.hids-price-matrix-th-devise {
  width: 150px;
}

.hids-price-matrix-th-action {
  width: 56px;
  text-align: center !important;
}

.hids-price-matrix-row-idx {
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.hids-price-matrix-table .hids-input {
  width: 100%;
  min-width: 0;
}

.hids-price-matrix-action-cell {
  text-align: center;
  vertical-align: middle;
}

.hids-price-matrix-action-cell .hids-price-matrix-remove {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hids-price-matrix-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.hids-price-matrix-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.hids-price-matrix-total-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.hids-price-matrix-total strong {
  color: var(--accent-light);
  font-family: ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
}

.hids-price-matrix-total-row td {
  background: var(--bg-hover);
  border-top: 2px solid var(--border);
  vertical-align: middle;
}

.hids-price-matrix-total-label-cell {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hids-price-matrix-total-value-cell {
  max-width: 150px;
  width: 150px;
}

.hids-price-matrix-total-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.35;
}

.hids-price-matrix-total-line {
  white-space: nowrap;
}

/* Mémo achat v3 — tableau besoin / PU / Qté */
.hids-price-matrix--v3 .hids-price-matrix-intro i {
  color: var(--accent-light);
}

.hids-price-matrix-table-wrap--v3 {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hids-price-matrix-table--v3 {
  min-width: 640px;
}

.hids-price-matrix-th-libelle,
.hids-price-matrix-col-libelle {
  min-width: 180px;
  width: 38%;
}

.hids-price-matrix-th-pu,
.hids-price-matrix-col-pu {
  width: 88px;
  max-width: 100px;
}

.hids-price-matrix-th-qte,
.hids-price-matrix-col-qte {
  width: 64px;
  max-width: 72px;
}

.hids-price-matrix-th-line-total,
.hids-price-matrix-col-total {
  width: 120px;
  text-align: right;
}

.hids-price-line-total {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
  text-align: right;
  padding: 8px 4px;
}

.hids-memo-prix-ref-table-wrap--v3,
.hids-memo-prix-custom-wrap--v3 {
  overflow-x: auto;
}

.hids-memo-prix-ref-table--v3 {
  min-width: 520px;
}

.hids-memo-prix-cell-libelle,
.hids-memo-prix-libelle-readonly {
  max-width: 220px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.hids-memo-prix-libelle-readonly {
  padding: 8px 10px;
  vertical-align: middle;
}

/* ── Pipeline prix Mémo test (Aperçu) ─────────────────────────────────────── */
.hids-memo-prix-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.hids-memo-prix-title-icon {
  color: var(--accent-light);
  margin-right: 6px;
}

.hids-memo-prix-lead {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

#hidsMemoPrixPipeline .hids-alert {
  margin-bottom: 16px;
}

.hids-memo-prix-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 20px;
  padding: 16px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.hids-memo-prix-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  flex: 1 1 0;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.hids-memo-prix-step-line {
  flex: 1 1 12px;
  height: 2px;
  min-width: 8px;
  margin-top: 15px;
  background: var(--border);
}

.hids-memo-prix-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
}

.hids-memo-prix-step-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.hids-memo-prix-step-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.25;
  max-width: 88px;
}

.hids-memo-prix-step--done .hids-memo-prix-step-dot {
  border-color: var(--success);
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
}

.hids-memo-prix-step--done .hids-memo-prix-step-label {
  color: var(--success);
}

.hids-memo-prix-step--current .hids-memo-prix-step-dot {
  border-color: var(--accent-primary);
  background: rgba(30, 111, 191, 0.15);
  color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(30, 111, 191, 0.12);
}

.hids-memo-prix-step--current .hids-memo-prix-step-label {
  color: var(--text-primary);
}

.hids-memo-prix-step--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.hids-memo-prix-all-done {
  margin-bottom: 16px;
}

.hids-memo-prix-pane + .hids-memo-prix-pane {
  margin-top: 8px;
}

.hids-memo-prix-reference {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
}

.hids-memo-prix-saved {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(99, 102, 241, 0.06);
}

.hids-memo-prix-reference-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.hids-memo-prix-reference-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.hids-memo-prix-reference-total {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
}

.hids-memo-prix-ref-table {
  margin: 0;
}

.hids-memo-prix-locked,
.hids-memo-prix-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hids-memo-prix-actions {
  margin-bottom: 14px;
}

.hids-memo-prix-custom {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.hids-memo-prix-custom-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.hids-memo-prix-custom-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.hids-memo-prix-custom-total {
  font-size: 12px;
  color: var(--text-secondary);
}

.hids-memo-prix-custom-total strong {
  font-family: ui-monospace, monospace;
  color: var(--accent-light);
  margin-left: 4px;
}

.hids-memo-prix-status {
  font-size: 12px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.hids-memo-prix-status--error {
  color: var(--danger);
}

@media (max-width: 768px) {
  .hids-memo-prix-stepper {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .hids-memo-prix-step {
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
  }

  .hids-memo-prix-step-line {
    display: none;
  }

  .hids-memo-prix-step-label {
    max-width: none;
    text-align: left;
  }
}

/* ── Itinéraire OM test ─────────────────────────────────────────────────── */
.hids-om-site-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-hover);
  overflow: hidden;
}
.hids-om-site-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.hids-om-site-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}
.hids-om-site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.hids-om-site-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.hids-om-site-block:not(.is-collapsed) .hids-om-site-chevron {
  transform: rotate(180deg);
}
.hids-om-site-body {
  padding: 0 16px 16px;
}
.hids-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hids-badge-required {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.hids-badge-optional {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

/* ── Sidebar enrichie — Aperçu Workflows ─────────────────────────────────── */
.hids-nav-workflows-premium {
  overflow: visible;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent-primary) 6%, transparent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: hids-wf-row-glow 6s ease-in-out infinite;
}

@keyframes hids-wf-row-glow {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

.hids-nav-workflows-premium .hids-nav-workflows-label {
  font-weight: 700 !important;
  letter-spacing: 0.012em;
  animation: hids-wf-label-shimmer 4.8s ease-in-out infinite;
  will-change: color, filter, text-shadow;
}

.hids-nav-workflows-premium:hover .hids-nav-workflows-label,
.hids-nav-workflows-premium.active .hids-nav-workflows-label {
  animation-duration: 3.6s;
}

@keyframes hids-wf-label-shimmer {
  0%, 100% {
    color: var(--text-secondary) !important;
    text-shadow: 0 0 0 transparent;
    filter: brightness(1);
  }
  50% {
    color: var(--accent-light) !important;
    text-shadow: 0 0 16px color-mix(in srgb, var(--accent-primary) 45%, transparent),
                 0 0 4px color-mix(in srgb, var(--accent-light) 30%, transparent);
    filter: brightness(1.15);
  }
}

.hids-wf-indicators {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 42px;
  position: relative;
}

.hids-wf-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 25%, transparent);
  transition: opacity 0.25s, transform 0.25s;
}

.hids-wf-dot--live {
  background: color-mix(in srgb, var(--success) 22%, transparent);
  color: var(--success);
}

.hids-wf-dot--reject {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}

.hids-wf-dot--empty {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.hids-wf-bubble-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.hids-wf-bubble {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scale(0.55);
  opacity: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hids-wf-bubble--live {
  background: var(--success);
  color: #fff;
}

.hids-wf-bubble--reject {
  background: var(--danger);
  color: #fff;
}

.hids-wf-bubble--show {
  animation: hids-wf-bubble-flash 2.1s ease-out forwards;
}

@keyframes hids-wf-bubble-flash {
  12% {
    opacity: 1;
    transform: translateY(-50%) translateX(2px) scale(1);
  }
  78% {
    opacity: 0.9;
    transform: translateY(-50%) translateX(8px) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(14px) scale(0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hids-nav-workflows-premium {
    animation: none;
    background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  }
  .hids-nav-workflows-premium .hids-nav-workflows-label {
    animation: none;
    color: var(--accent-light) !important;
  }
  .hids-wf-bubble--show {
    animation: none;
    opacity: 0;
  }
}

/* ── Créer document — overlays loading + modale succès ─────────────────── */

.hids-creer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hids-creer-overlay-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.hids-creer-loading-panel {
  padding: 32px 40px;
  min-width: 280px;
  max-width: 360px;
}

.hids-creer-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid rgba(30, 111, 191, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: hids-creer-spin 0.85s linear infinite;
}

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

.hids-creer-loading-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.hids-creer-loading-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.hids-creer-success-panel {
  width: 100%;
  max-width: 480px;
  padding: 32px 28px 24px;
  animation: hids-creer-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hids-creer-modal-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hids-creer-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  font-size: 28px;
}

.hids-creer-success-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hids-creer-success-msg {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.hids-creer-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .hids-creer-spinner {
    animation: none;
    border-top-color: var(--accent-primary);
  }
  .hids-creer-success-panel {
    animation: none;
  }
}

/* Création — sélection multiple utilisateurs (ordre de mission, etc.) */
.hids-user-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
}

.hids-user-multi-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.35;
}

.hids-user-multi-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-primary);
}

.hids-user-multi-item span {
  word-break: break-word;
}

/* ── Bulles d'aide Aperçu (onboarding éphémère) ── */
.hids-onboard-callout {
  position: fixed;
  z-index: 2100;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #1a6fbf;
  background: #ffffff;
  color: #0d1117;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: none;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.18),
    0 2px 8px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.hids-onboard-callout::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 2px solid #1a6fbf;
  border-top: 2px solid #1a6fbf;
  transform: rotate(45deg);
}

.hids-onboard-callout[data-placement='bottom']::before {
  top: -7px;
  left: 50%;
  margin-left: -6px;
}

.hids-onboard-callout[data-placement='top']::before {
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
  transform: rotate(225deg);
}

.hids-onboard-callout--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hids-onboard-callout--hide {
  opacity: 0;
  transform: translateY(-6px) scale(0.94);
}

.hids-apercu-chrome--footer .hids-apercu-toolbar {
  border-bottom: none;
}

.hids-apercu-chrome--footer .hids-apercu-tool-hint {
  border-bottom: none;
}
