/* Multi-select dropdown */
.ms .count { font-variant-numeric: tabular-nums; }

.ms-menu {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 6px);
  width: 100%;
  max-height: 240px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  z-index: 10;
  display: none;
}
.ms[aria-expanded="true"] .ms-menu { display: block; }

.ms-menu .opt {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
}
.ms-menu .opt:hover { background: #f8fafc; }
.ms-menu input[type="checkbox"] { accent-color: var(--primary); }

.pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  background:var(--primary-faded);
  border-radius:999px;
  font-size:12px;
}

/* details-based multi-select */
.ms { position: relative; }
.ms > summary {
  list-style: none; cursor: pointer; outline: none;
  display: inline-flex; align-items: center; justify-content: space-between; width: 100%;
}
.ms > summary::-webkit-details-marker { display: none; }

.ms .ms-menu {
  position: absolute; left: 0; right: 0;
  margin-top: 6px; padding: 8px;
  background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  max-height: 280px; overflow: auto; z-index: 1000;
  display: none;
}
.ms[open] .ms-menu { display: block; background: var(--bg); scrollbar-width: thin;}

.ms .opt { padding: 6px 4px; border-radius: 8px; }
.ms .opt:hover { background: rgba(0,0,0,.04); }
.ms .count.pill { margin-left: 8px; color: var(--text); }

.label{ color: var(--text)}
fieldset {border-radius: 20px; box-shadow: var(--shadow); padding-top: 0; border:0;}
/* === Modal base === */
/* Using native <dialog>. Let the 'open' attribute control visibility. */
dialog.modal { position: fixed; inset: 0; display: none; z-index: 1000; }
dialog.modal[open] { display: block; }

.modal.sm .modal-dialog { max-width: 520px; }
.icon-btn.close { background: var(--primary-faded); border: 0; font-size: 18px; cursor: pointer; }
.icon-btn.close:hover { color: #fff; }
.btn.w-100 { width: 100%; }

.list {display: grid;gap: 8px;margin-bottom: 5px;}
.list .row {display: flex;margin:2px;align-items: center;justify-content: space-between;padding: 5px 2px;border-radius: 10px;}
.list .row label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.list small { color: #aaa; }
