/* What each document type does: one view, on the Admin page and in the window the canvas opens. */
.document-types{display:grid;gap:12px}
.document-types .admin-note{margin:0;color:#475467;font-size:13px}
.document-types-effect{font-size:13px;color:#344054}
.document-types-effect summary{cursor:pointer;font-weight:600}
.document-types-effect ul{margin:8px 0 0;padding-left:18px;display:grid;gap:4px}
.document-types-rows{display:grid;gap:10px}
.document-type-row{margin:0;padding:10px 12px 12px;border:1px solid #e4e7ec;border-radius:10px;min-width:0}
.document-type-row legend{padding:0 6px;font-size:14px}
.document-type-code{margin-left:4px;padding:1px 6px;border-radius:6px;background:#f2f4f7;color:#475467;font-size:11px;font-weight:600}
.document-type-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px 14px;align-items:end}
.document-type-field{display:grid;gap:4px;margin:0;font-size:12px;font-weight:500;color:#344054;min-width:0}
.document-type-field[hidden]{display:none}
.document-type-field input[type=number],.document-type-field input[type=text],.document-type-field select{width:100%;min-width:0;box-sizing:border-box;height:34px;padding:4px 8px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;font:inherit;font-weight:400}
.document-type-field :disabled{background:#f9fafb;color:#667085}
.document-type-check{grid-template-columns:auto 1fr;align-items:center;gap:8px;min-height:34px}
/* The type's names (Admin page only), above its settings, and the functions' names: wider boxes, a name is words. */
.document-type-names,.document-function-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px 14px;align-items:end}
.document-type-names{margin-bottom:10px}
.document-function-code{justify-self:start;padding:1px 6px;border-radius:6px;background:#f2f4f7;color:#475467;font-size:11px;font-weight:600}
/* A function with what holds it ("Used by 12 documents"), or its Remove when nothing does (Bryan's retest, 2026-11-04). */
.document-function-fields[data-function-list]{align-items:start}
.document-function{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:end;min-width:0}
.document-function .document-type-field{min-width:0}
.document-function-remove{height:34px;padding:0 12px;border-radius:8px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.document-function-note{grid-column:1/-1;color:#667085;font-size:12px;font-weight:400}
.document-function-note[hidden]{display:none}
.document-function[data-removing] .document-function-code,.document-function[data-removing] input{text-decoration:line-through;color:#98a2b3}
/* A review period in whole years, beside its days ("2 years"). */
.document-type-period{display:block;color:#667085;font-size:12px;font-weight:400}
.document-type-period:empty{display:none}
/* A new function (Admin page only): its code and its name, under the ones kept. */
.document-function-add{display:grid;gap:8px;margin-top:12px;padding-top:10px;border-top:1px dashed #e4e7ec}
.document-function-add-title{margin:0;font-size:13px;color:#344054}
.document-function-add input[data-add-function=code]{text-transform:uppercase}
.document-type-check input{width:16px;height:16px;margin:0}
.document-types-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px}
.document-types-problem{flex:1;margin:0;color:#b42318;font-size:13px}
.document-types-problem[hidden]{display:none}
/* The window. Wide on a desktop, the whole width on a phone; its body scrolls, its head and Save stay. */
dialog.document-types-window{width:min(980px,calc(100% - 32px));max-height:calc(100dvh - 48px);padding:0;overflow:hidden}
dialog.document-types-window[open]{display:flex;flex-direction:column}
.document-types-window-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 22px 12px;border-bottom:1px solid #eaecf0}
.document-types-window-head h2{margin:0;font-size:18px}
.document-types-window-head .eyebrow{margin:0 0 2px}
.document-types-window-close{width:36px;height:36px;flex:none;border:1px solid #d0d5dd;border-radius:8px;background:#fff;font-size:20px;line-height:1;cursor:pointer}
.document-types-window-body{padding:14px 22px 18px;overflow:auto;min-height:0}
.document-types-window .document-types-actions{position:sticky;bottom:-18px;margin-bottom:-18px;padding:10px 0 14px;background:#fff}
/* The link in the step's description. */
.document-types-link{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}
.document-types-link-row{margin:8px 0}
@media (max-width:560px){
  dialog.document-types-window{width:100%;max-width:100%;max-height:100dvh;height:100dvh;border-radius:0;margin:0}
  .document-types-window-head{padding:14px 16px 10px}
  .document-types-window-body{padding:12px 16px 16px}
  .document-type-fields{grid-template-columns:1fr 1fr}
  .document-type-field[data-title-field]{grid-column:1/-1}
}
/* Save: the theme gives it its colour; its size and type are set here, the same on both pages. */
.document-types-actions button{min-height:36px;padding:0 18px;border-radius:8px;font:inherit;font-size:13px;font-weight:600;line-height:1;cursor:pointer}
