/* Management pages: Permissions, Departments & Divisions, Website Logs, Bot & Integrations.
   Uses the tokens from staff.css. */
[hidden] { display: none !important; }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.perm-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); line-height: 1.5; }
.perm-list li .badge { margin-left: 6px; }
.perm-list.sm { gap: 6px; }
.perm-list.sm li { padding: 6px 10px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inline-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }
.inline-actions input:not([type="checkbox"]) { height: 30px; padding: 0 10px; font-size: 13px; max-width: 200px; }
.perm-list.sm .inline-actions { margin: 0; }
.mt-s { margin-top: 8px; }
.nowrap { white-space: nowrap; }
.clip { max-width: 320px; overflow-wrap: anywhere; }
.plain { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }

.org-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-content: start; }
.org-card { display: block; color: inherit; border-left: 4px solid var(--tone, var(--accent)); transition: transform .15s, border-color .15s; }
.org-card:hover { transform: translateY(-2px); }
.org-card h2 { display: flex; align-items: center; gap: 8px; }
.pos-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; align-content: start; }

.warn-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }
.warn-card h2 { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.danger-zone { border-color: color-mix(in srgb, var(--crimson) 40%, var(--line)); }
.danger-zone h2 { color: var(--crimson); }
.setting-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.log-table td { font-size: 13px; }

ul.timeline { list-style: none; margin: 0; }
ul.timeline li { position: relative; }
ul.timeline li::before { content: ""; position: absolute; left: -19px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* Departments added later get a neutral badge until they have their own color class. */
.badge[class*="dept-"] { border-color: transparent; }

@media (max-width: 760px) {
  .inline-actions input:not([type="checkbox"]) { max-width: 100%; }
}

/* ---------- Users & Profiles ---------- */
.profile-head { display: flex; align-items: center; gap: 22px; }
.profile-head .profile-id { flex: 1; min-width: 0; }
.profile-head h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.avatar.xl { width: 96px; height: 96px; border-radius: 16px; font-size: 30px; object-fit: cover; }
.section-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }
.modtool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.modtool { display: grid; gap: 8px; align-content: start; }
.modtool .block-label { margin: 0; }
.modtool input, .modtool select { height: 34px; font-size: 13px; }
.muted-row, li.muted-row { opacity: .55; }
.confirm-box { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.bad-text { color: var(--crimson); }
@media (max-width: 640px) { .profile-head { flex-direction: column; align-items: flex-start; } }

/* ---------- Meetings ---------- */
.meeting-card { display: block; color: inherit; border-left: 4px solid var(--accent); transition: transform .15s; }
.meeting-card:hover { transform: translateY(-2px); }
.avail-wrap { overflow-x: auto; }
table.avail { border-collapse: separate; border-spacing: 3px; width: auto; user-select: none; touch-action: none; }
table.avail th { font-size: 12px; font-weight: 600; text-align: center; padding: 2px 6px; white-space: nowrap; border: 0; }
table.avail tbody th { text-align: right; }
table.avail td { width: 58px; height: 24px; padding: 0; border-radius: 5px; border: 1px solid var(--line); cursor: pointer; text-align: center; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--accent) calc(var(--heat, 0) * 85%), var(--surface-2)); color: var(--text); }
table.avail td span { opacity: .8; }
table.avail td.mine { outline: 2px solid var(--ok, #3ecf8e); outline-offset: -2px; }
table.avail td:hover { border-color: var(--accent); }

/* ---------- Administration Inbox ---------- */
ul.inbox-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ul.inbox-thread li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); max-width: 85%; }
ul.inbox-thread li.from-admin { margin-left: auto; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
ul.inbox-thread .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 13px; }
ul.inbox-thread .body { white-space: pre-wrap; line-height: 1.55; }

/* ---------- Home: backlog ---------- */
.backlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.backlog li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; }
.backlog li a:hover { border-color: var(--accent); }
.backlog li.urgent a { border-color: color-mix(in srgb, var(--crimson) 50%, var(--line)); }
.backlog .n { font-family: var(--font-display); font-size: 20px; min-width: 34px; text-align: center; }
.backlog .why { margin-left: auto; font-size: 12px; }
.modtool-panel > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.modtool-panel > summary::before { content: '+'; font-weight: 800; color: var(--accent); width: 14px; }
.modtool-panel[open] > summary::before { content: '\2212'; }
