/* Administration screens: Users, Settings, Audit log, Integrations, Message log. Uses the shared tokens from app.css; colour only for status. */

/* ---------- settings layout: section list on the left, content on the right */
.adm-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; }
.adm-subnav { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem; position: sticky; top: 76px; }
.adm-subnav-item { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .45rem .7rem; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.adm-subnav-item:hover { background: var(--surface-2); }
.adm-subnav-item.active { background: var(--nav); color: #fff; font-weight: 600; }
.adm-content { min-width: 0; }
@media (max-width: 1100px) {
  .adm-layout { grid-template-columns: minmax(0, 1fr); }
  .adm-subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .adm-subnav-item { flex: 0 1 auto; }
}

.adm-note { display: flex; align-items: flex-start; gap: .25rem; margin: 0 0 .9rem; }
.adm-note .icon { margin-top: .15rem; }
.adm-ul { margin: 0; padding-left: 1.2rem; }
.adm-warn-slot:empty { display: none; }
.adm-warn-slot .alert { margin: 0; }
.adm-spacer { display: block; }
.adm-grow { flex: 1; min-width: 0; }
.adm-gap { margin-top: 1rem; }
.adm-nowrap { white-space: nowrap; }
.adm-wrap { overflow-wrap: anywhere; }
.adm-err { color: var(--red); overflow-wrap: anywhere; }
.adm-badges { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }

/* ---------- copy field, secrets */
.adm-copy { display: flex; gap: .4rem; align-items: center; min-width: 0; }
.adm-copy .input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; background: var(--surface-2); }
.adm-secret { display: flex; gap: .6rem; align-items: center; }
.adm-secret .input { flex: 1; min-width: 0; }
.adm-inline-check { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; white-space: nowrap; font-size: .92rem; }
.adm-inline-check input { width: 20px; height: 20px; }
.field-label .badge { margin-left: .25rem; font-weight: 600; }

/* ---------- role and step check cards (users) */
.adm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.adm-check-card { display: flex; align-items: center; gap: .65rem; min-height: 56px; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.adm-check-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.adm-check-card input { width: 22px; height: 22px; flex-shrink: 0; }
.adm-check-card > span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.adm-check-card:has(input:checked) { border-color: var(--nav); box-shadow: inset 0 0 0 1px var(--nav); }
.adm-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .adm-split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- ordered editors (Job Type steps, checklist, reasons) */
.adm-order { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .35rem; }
.adm-order-row { display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-height: 52px; flex-wrap: wrap; }
.adm-order-row.adm-inactive { background: var(--surface-2); color: var(--muted); }
.adm-order-n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--grey-bg); font-weight: 700; font-size: .85rem; }
.adm-order-text { flex: 1; min-width: 140px; font-weight: 600; }
.adm-order-input { flex: 1; min-width: 180px; }
.adm-order-btns { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.adm-order-empty { padding: .6rem; }
.adm-add-row { margin-top: .25rem; }
.adm-add-row .input { flex: 1; min-width: 200px; max-width: 420px; }
.adm-year { width: auto; min-width: 110px; }

/* ---------- step icons */
.adm-icon-cell { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--grey-bg); }
.adm-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem; }
.adm-icon-opt { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .25rem; min-height: 80px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; position: relative; }
.adm-icon-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.adm-icon-opt:has(input:checked) { border-color: var(--nav); background: var(--nav); color: #fff; }
.adm-icon-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---------- logo */
.adm-logo-row { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.adm-logo { width: 200px; display: grid; justify-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: .6rem; }
.adm-logo img { width: 100%; height: 100px; object-fit: contain; }
.adm-logo-actions { flex: 1; min-width: 240px; display: grid; gap: .6rem; }

/* ---------- message templates */
.adm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; }
.adm-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .35rem; }
.adm-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: .2rem .6rem; min-height: 32px; font: inherit; font-size: .82rem; cursor: pointer; color: var(--text); }
.adm-chip:hover { border-color: var(--nav); }
.adm-preview { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: .75rem; background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; }
.adm-preview-subj { font-weight: 700; margin: .25rem 0; }

/* ---------- logs */
.adm-toolbar { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.adm-record { width: 220px; }
.adm-range { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.adm-date { display: inline-flex; align-items: center; gap: .3rem; }
.adm-date .input { width: auto; min-width: 150px; }
.adm-diff { display: grid; gap: .15rem; font-size: .88rem; max-width: 560px; overflow-wrap: anywhere; }
.adm-diff-key { color: var(--muted); font-weight: 600; }
.adm-old { text-decoration: line-through; text-decoration-color: rgba(159, 21, 12, .5); color: var(--grey); }
.adm-new { color: var(--text); font-weight: 600; }
.adm-arrow { color: var(--muted); }
.adm-diff details summary { cursor: pointer; color: var(--link); min-height: 28px; }
.adm-act-bad { color: var(--red); }
.adm-msg-body { white-space: pre-line; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }

/* ---------- integration health tiles */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.adm-tile { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--green-solid); border-radius: var(--radius); padding: .75rem .9rem; display: grid; gap: .3rem; font-size: .92rem; box-shadow: var(--shadow); }
.adm-tile-bad { border-left-color: var(--red-solid); }
.adm-tile-warn { border-left-color: var(--amber-solid); }
.adm-tile-off { border-left-color: var(--border-strong); }
.adm-tile-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .2rem; font-size: 1rem; }

@media (max-width: 700px) {
  .adm-record { width: 100%; }
  .adm-date .input { min-width: 0; }
}

/* ---------- Job Type cards */
.adm-jt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.adm-jt { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; display: grid; gap: .55rem; align-content: start; background: var(--surface); }
.adm-jt-off { border-style: dashed; background: var(--surface-2); }
.adm-jt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; flex-wrap: wrap; }
.adm-jt-head h3 { margin: 0; font-size: 1.1rem; }
.adm-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; counter-reset: flow; }
.adm-flow li { counter-increment: flow; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .88rem; }
.adm-flow li::before { content: counter(flow) "."; font-weight: 700; color: var(--muted); }
.adm-flow li.adm-flow-off { border-color: var(--amber-solid); color: var(--amber); }
.adm-jt-facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0; font-size: .9rem; }
.adm-jt-facts dt { color: var(--muted); }
.adm-jt-facts dd { margin: 0; }
.adm-jt-foot { display: flex; justify-content: flex-end; }

.adm-chip-static { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--blue-bg); color: var(--blue); font-weight: 600; }
