.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-grid:has(> .stat-card:only-child) { grid-template-columns: 1fr; }
.table-subtitle { display: block; color: var(--muted); margin-top: 4px; }
.permission-cell { max-width: 340px; white-space: normal; }
.permission-chip { display: inline-flex; margin: 2px; padding: 4px 7px; border-radius: 999px; background: #edf1f7; color: #4b586a; font-size: 10px; font-weight: 700; }
.permission-more { color: var(--muted); font-size: 11px; font-weight: 700; }
.table-action { border: 0; padding: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; }
.actions form { margin: 0; }
.user-form-container { max-width: 860px; }
.field #id_permissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 10px; }
.field #id_permissions label { font-weight: 600; color: #434955; }
.department-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.department-card { min-height: 155px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 25px rgba(31,35,43,.055); }
.department-card:hover { text-decoration: none; border-color: #d4abb6; }
.department-card strong { font-size: 18px; }
.department-card p { color: var(--muted); line-height: 1.5; }
.department-card span { color: var(--primary); font-size: 12px; font-weight: 750; }
.department-card small { color: var(--danger); }
@media (max-width: 800px) { .department-grid { grid-template-columns: 1fr; } .field #id_permissions { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .heading-actions, .heading-actions .button { width: 100%; } }
