/* Users & access, change password, compare picker. Uses the variables from app.css. */

.small { font-size: .82rem; }
.hint { font-size: .82rem; color: var(--muted); margin: .1rem 0 .6rem; }
.form-error { color: var(--danger); background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; margin: .5rem 0; }
.notice { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--blue-800); border-radius: 8px; padding: .6rem .85rem; }
a.user-chip { color: inherit; text-decoration: none; }
a.user-chip:hover { text-decoration: underline; }

.btn-danger { background: #fff; color: var(--danger); border: 1px solid #fecdca; }
.btn-danger:hover:not([disabled]) { background: #fef3f2; }
.actions .btn-danger { margin-right: auto; }
.link-btn { border: 0; background: none; color: var(--blue-600); font: inherit; font-size: .8rem; cursor: pointer; padding: 0 .25rem; }
.link-btn:hover { text-decoration: underline; }

/* tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; }
.tabs a { padding: .55rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .92rem; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--blue-700, var(--blue-600)); border-bottom-color: var(--blue-600); }

/* list + editor */
.admin-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 1.25rem; align-items: start; }
.admin-layout > :only-child { grid-column: 1 / -1; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.admin-search { flex: 1 1 220px; max-width: 360px; padding: .55rem .75rem; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
.admin-search:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(29, 120, 216, .18); }
.admin-table tr.clickable { cursor: pointer; }
.admin-table tr.selected td { background: #eff6ff; }
.admin-editor { position: sticky; top: 1rem; }
.admin-editor h3 { font-size: .95rem; margin: 1.25rem 0 .35rem; }
.admin-form { margin-top: .5rem; }
.admin-form label { margin-top: .5rem; }
.admin-subsection { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: .25rem; }
.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; padding: .55rem .75rem; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }

/* checkboxes */
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .92rem; font-weight: 400 !important; color: var(--text) !important; cursor: pointer; padding: .25rem 0; }
.form .check input, .check input { width: auto; margin: .2rem 0 0; flex: none; accent-color: var(--blue-600); }
.check-list { display: flex; flex-direction: column; gap: .1rem; max-height: 260px; overflow-y: auto; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 10px; background: #fbfdff; }
.check-list.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-height: none; }

/* groups */
.group-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.group-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.group-list li:hover { border-color: #bfdbfe; }
.group-list li.selected { border-color: var(--blue-500); background: #eff6ff; }
.group-meta { white-space: nowrap; }
.perm-group { margin-bottom: .75rem; }
.perm-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .88rem; }

/* compare picker */
.compare-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: 1rem 0 .5rem; }
.compare-pick label { display: block; margin-bottom: .3rem; font-size: .78rem; font-weight: 600; color: #334155; }
.compare-pick select { min-width: 220px; padding: .5rem .7rem; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; background: #fff; }
.swap-btn { font-size: 1.1rem; padding: .45rem .8rem; }

.narrow-page { max-width: 520px; margin: 0 auto; }
.access-denied { text-align: center; padding-top: 3rem; }

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-editor { position: static; }
}

/* ---------- Monitoring page ---------- */
.tab-btn { border: 0; background: none; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: .55rem .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.mon-stats { margin: 1rem 0; }
.mon-charts { margin-bottom: .5rem; }
.mon-check { align-self: center; margin-top: 1.2rem; }
.mon-table td { vertical-align: top; }
.mon-table tr.clickable { cursor: pointer; }
.mon-table tr.clickable:hover td { background: #f8fafc; }
.nowrap { white-space: nowrap; }
.detail-row td { background: #fbfdff; }
.detail-row .facts { margin-bottom: .6rem; }
.log-pre { margin: .4rem 0 0; padding: .75rem; max-height: 360px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: 8px; font-size: .78rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.action-chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef2f7; color: #334155; white-space: nowrap; }
.action-chip.chip-bad { background: #fde4e1; color: #7d1f16; }
.action-chip.chip-warn { background: #ffeccc; color: #7a4b00; }
.action-chip.chip-change { background: #e3eefc; color: var(--blue-800); }
.action-chip.chip-auth { background: #dcf5e8; color: #14633f; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: .25rem; }
.mini-bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.mini-bar { width: 100%; background: var(--blue-500); border-radius: 3px 3px 0 0; min-height: 0; }
.mini-bar.danger { background: #d92d20; }
.mini-bars-axis { display: flex; justify-content: space-between; margin-top: .25rem; }
