.workflow-folder-private {
  background: #f7d3d9 !important;
  color: #792138 !important;
  border-color: #d97889 !important;
}
.workflow-folder-shared {
  background: #eee5fa !important;
  color: #503a72 !important;
  border-color: #c3aedf !important;
}
.workflow-folder-private:is(:hover, :focus-visible, .active) {
  background: #f3c1ca !important;
  border-color: #c35165 !important;
}
.workflow-folder-private.search-match-folder,
.workflow-folder-shared.search-match-folder {
  box-shadow: inset 3px 0 #087c9c;
}

/* The lock is an accessory, not another folder row.
   Preserve the same caret / folder / title / counter columns as normal folders,
   and reserve a fifth, fixed-width slot for the lock beside the counter.
   It also works when the badge was inserted before the caret in DOM order. */
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared) {
  grid-template-columns: 12px auto minmax(0, 1fr) 22px auto;
  grid-template-rows: minmax(19px, auto);
  align-items: center;
  min-width: 0;
}
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared) > .sidebar-tree-caret {
  grid-column: 1;
  grid-row: 1;
}
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared) > .sidebar-urbanisme-folder-icon {
  grid-column: 2;
  grid-row: 1;
}
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared)
  > :is(.sidebar-urbanisme-folder-label, span:not([class])) {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared) > [data-folder-privacy-badge] {
  grid-column: 4;
  grid-row: 1;
  justify-self: center;
}
.sidebar-alsh-folder.has-tree-toggle:is(.workflow-folder-private, .workflow-folder-shared) > small {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
}

/* A stronger lock, still compact and aligned with ordinary folder glyphs. */
.workflow-folder-privacy-badge {
  box-sizing: border-box;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 19px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #912038;
  background: #f8dee2;
}
.workflow-folder-private > .workflow-folder-privacy-badge {
  color: #ffffff !important;
  background: #b7314b;
  border-color: #a82a43;
}
.workflow-folder-shared > .workflow-folder-privacy-badge {
  color: #5c3981 !important;
  background: #e6d9f5;
  border-color: #c8b2e0;
}
.workflow-folder-privacy-badge svg {
  flex: none;
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.modal-backdrop.ged-folder-privacy-backdrop { z-index: 12000; display: grid; place-items: center; padding: 16px; }
.ged-folder-privacy-modal { width: min(540px,calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 8px; }
.ged-folder-privacy-modal .ged-message-form { gap: 16px; }
.ged-folder-privacy-modal h3 { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; margin: 0; }
.ged-folder-privacy-members { max-height: 320px; overflow-y: auto; padding: 12px; margin: 0; border: 1px solid #cfdcdd; border-radius: 4px; }
.ged-folder-privacy-members label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; overflow-wrap: anywhere; }
.ged-folder-privacy-members label[hidden] { display: none; }
.ged-folder-privacy-members input { flex: 0 0 auto; margin-top: 3px; }
.ged-folder-privacy-status { color: #503a72; font-weight: 600; }
.ged-privacy-recovery-dialog { width: min(780px,calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; border: 1px solid #cfdcdd; border-radius: 8px; color: #183744; background: white; }
.ged-privacy-recovery-dialog::backdrop { background: #163d4b66; }
.ged-privacy-recovery-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ged-privacy-recovery-dialog h2 { font-size: 22px; }
.ged-privacy-recovery-dialog form label { display: grid; gap: 8px; margin: 16px 0; }
.ged-privacy-recovery-confirm { display: flex; gap: 10px; margin: 20px 0; align-items: flex-start; }
.ged-privacy-recovery-confirm input { margin-top: 4px; }
.ged-privacy-recovery-row { border-top: 1px solid #cfdcdd; padding: 16px 0; display: grid; gap: 12px; }
.ged-privacy-recovery-row strong { overflow-wrap: anywhere; }
@media (max-width: 480px) { .ged-folder-privacy-modal .ged-message-actions { flex-wrap: wrap; gap: 8px; } }
