/* Shared admin/list page styles */
@import url('task-cards.css');
@import url('theme.css?v=46');
@import url('resizable-panels.css');

.admin-page {  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-6);
  gap: var(--space-4);
  overflow: hidden;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.page-toolbar--actions-only {
  justify-content: flex-end;
}
.page-toolbar h1 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-toolbar p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.admin-layout {
  flex: 1;
  min-height: 0;
  min-width: 1000px;
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
}

.admin-layout__primary,
.admin-layout__secondary {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-layout__primary {
  flex: 1 1 0;
  min-width: 0;
}

.admin-layout__secondary {
  flex: 0 0 38%;
  min-width: 420px;
  max-width: 560px;
}

.admin-layout__primary > .panel,
.admin-layout__secondary > .panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.panel-header--list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  height: auto;
  min-height: var(--panel-header-height);
  max-height: none;
  padding: var(--panel-header-padding-y) var(--panel-header-padding-x);
}
.panel-header--list .panel-header-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-width: 0;
}
.panel-header--list .panel-header-intro p {
  margin-top: 0;
  white-space: nowrap;
}
.panel-header--list .list-toolbar {
  margin-bottom: 0;
  gap: var(--space-2);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  vertical-align: middle;
}
.data-table th {
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-table-header-text, #f5f2ee);
  background: var(--color-table-header, #4a4744);
  position: sticky;
  top: 0;
  z-index: 1;
  vertical-align: middle;
}
.data-table thead th:first-child {
  border-top-left-radius: var(--radius-md);
}
.data-table thead th:last-child {
  border-top-right-radius: var(--radius-md);
}
.data-table th .list-table-sort-btn {
  color: inherit;
}
.data-table th .list-table-sort-btn:hover,
.data-table th .list-table-sort-btn.is-active {
  color: var(--color-table-header-text, #f5f2ee);
}
.data-table th .list-table-sort-icon {
  color: var(--color-table-header-muted, #c4bfb8);
}
.data-table th .list-table-sort-btn:hover .list-table-sort-icon,
.data-table th .list-table-sort-btn.is-active .list-table-sort-icon {
  color: var(--color-table-header-text, #f5f2ee);
}

.list-table-sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.list-table-sort-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.list-table-sort-btn:hover {
  color: var(--color-text);
}
.list-table-sort-btn.is-active {
  color: var(--color-text);
}
.list-table-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 16px;
  color: var(--color-text-muted);
}
.list-table-sort-icon--neutral {
  flex-direction: column;
  gap: 2px;
}
.list-table-sort-arrow {
  display: block;
  width: 12px;
  height: 6px;
}
.list-table-sort-svg--active {
  display: block;
  width: 16px;
  height: 16px;
}
.data-table .list-table-sort-btn {
  gap: 3px;
}
.data-table th .list-table-sort-btn {
  max-width: 100%;
}
.data-table th.col-online .list-table-sort-btn,
.data-table th.col-status .list-table-sort-btn,
.data-table th.col-actions .list-table-sort-btn,
.data-table th.col-type .list-table-sort-btn {
  gap: 2px;
}
.data-table th.col-online,
.data-table th.col-actions {
  text-align: center;
}
.data-table th.col-online .list-table-sort-btn,
.data-table th.col-actions .list-table-sort-btn {
  justify-content: center;
}
.data-table th.col-online .list-table-sort-label,
.data-table th.col-actions .list-table-sort-label {
  flex: 0 1 auto;
}
.data-table td.col-client {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-table-sort-icon--neutral .list-table-sort-arrow {
  opacity: 0.8;
}
.list-table-sort-btn:hover .list-table-sort-icon {
  color: var(--color-text);
}
.list-table-sort-btn:hover .list-table-sort-icon--neutral .list-table-sort-arrow {
  opacity: 1;
}
.list-table-sort-btn.is-active .list-table-sort-icon {
  color: var(--color-primary);
}
[data-theme="dark"] .list-table-sort-icon {
  color: var(--color-text-muted);
}
[data-theme="dark"] .list-table-sort-btn.is-active .list-table-sort-icon {
  color: var(--color-primary);
}
.data-table tr:hover td { background: var(--color-surface-2); }
.data-table tr.is-selected td {
  background: var(--color-row-selected);
}
.data-table--clickable tbody tr.is-selected td {
  background: var(--color-row-selected);
}
.data-table .actions {
  white-space: nowrap;
  vertical-align: top;
}
.data-table .actions .btn-ghost:not(:last-child) {
  margin-right: var(--space-2);
}

.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.12);
}.field textarea { min-height: 72px; resize: vertical; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.field-hint {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover {
  background: oklch(from var(--color-primary) l c h / 0.15);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.btn-ghost:hover {
  color: var(--color-primary);
  border-color: oklch(from var(--color-primary) l c h / 0.35);
}
.btn-ghost--danger:hover {
  color: var(--color-primary);
}

.form-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge--client {
  color: #1e5aa8;
  background: #eef4fc;
}
.badge--owner {
  color: #7c3aed;
  background: #f3effc;
}
.badge--worker {
  color: #15803d;
  background: #ecfdf3;
}
.badge--admin {
  color: #b8860b;
  background: #fef9e7;
}
.badge--super {
  color: #c0000a;
  background: #fdf0f0;
}
.badge--supplier {
  color: #c2410c;
  background: #fff7ed;
}
.badge--new {
  color: #0369a1;
  background: #e0f2fe;
}
.badge--active,
.badge--viewer,
.badge--inactive {
  color: var(--color-text-muted);
  background: var(--color-surface-2);
}
[data-theme="dark"] .badge--new {
  color: #7dd3fc;
  background: #102a36;
}
[data-theme="dark"] .badge--client {
  color: #5b9fd4;
  background: #1a2836;
}
[data-theme="dark"] .badge--owner {
  color: #b090e0;
  background: #261e36;
}
[data-theme="dark"] .badge--worker {
  color: #4ade80;
  background: #1a2e24;
}
[data-theme="dark"] .badge--admin {
  color: #eab308;
  background: #2a2410;
}
[data-theme="dark"] .badge--super {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
[data-theme="dark"] .badge--supplier {
  color: #fb923c;
  background: #3d1f12;
}

/* User type selects — match role badge colors in panel and dropdown */
.user-type-select {
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.user-type-select option.user-type-option--all {
  color: var(--color-text);
  background: var(--color-surface);
}
.user-type-select.user-type-select--user,
.user-type-select option.user-type-option--user {
  color: #1e5aa8;
  background: #eef4fc;
}
.user-type-select.user-type-select--owner,
.user-type-select option.user-type-option--owner {
  color: #7c3aed;
  background: #f3effc;
}
.user-type-select.user-type-select--worker,
.user-type-select option.user-type-option--worker {
  color: #15803d;
  background: #ecfdf3;
}
.user-type-select.user-type-select--admin,
.user-type-select option.user-type-option--admin {
  color: #b8860b;
  background: #fef9e7;
}
.user-type-select.user-type-select--super-admin,
.user-type-select option.user-type-option--super-admin {
  color: #c0000a;
  background: #fdf0f0;
}
.user-type-select.user-type-select--supplier,
.user-type-select option.user-type-option--supplier {
  color: #c2410c;
  background: #fff7ed;
}
[data-theme="dark"] .user-type-select.user-type-select--user,
[data-theme="dark"] .user-type-select option.user-type-option--user {
  color: #5b9fd4;
  background: #1a2836;
}
[data-theme="dark"] .user-type-select.user-type-select--owner,
[data-theme="dark"] .user-type-select option.user-type-option--owner {
  color: #b090e0;
  background: #261e36;
}
[data-theme="dark"] .user-type-select.user-type-select--worker,
[data-theme="dark"] .user-type-select option.user-type-option--worker {
  color: #4ade80;
  background: #1a2e24;
}
[data-theme="dark"] .user-type-select.user-type-select--admin,
[data-theme="dark"] .user-type-select option.user-type-option--admin {
  color: #eab308;
  background: #2a2410;
}
[data-theme="dark"] .user-type-select.user-type-select--super-admin,
[data-theme="dark"] .user-type-select option.user-type-option--super-admin {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
[data-theme="dark"] .user-type-select.user-type-select--supplier,
[data-theme="dark"] .user-type-select option.user-type-option--supplier {
  color: #fb923c;
  background: #3d1f12;
}

.empty-state {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}

.list-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: 0;
  flex-shrink: 0;
}
.list-search-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.list-search-row .list-search {
  flex: 0 1 auto;
  min-width: 0;
}
.list-search-row__action {
  margin-left: auto;
  flex-shrink: 0;
}
.list-search--compact {
  width: min(220px, 100%);
  max-width: 220px;
}
.list-search {
  position: relative;
}
.list-search svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: var(--icon-14);
  height: var(--icon-14);
  color: var(--color-text-faint);
  pointer-events: none;
}
.list-search input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) calc(var(--space-3) + 18px);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.list-search input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.list-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.list-search--autocomplete {
  position: relative;
}

.list-search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md, 0 8px 24px oklch(0 0 0 / 0.12));
}

.list-search-suggestions__item {
  padding: 6px var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-search-suggestions__item:hover,
.list-search-suggestions__item.is-active {
  background: var(--color-primary-light);
  color: var(--color-text);
}
.list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}
.list-filter {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}
.list-filter[hidden] {
  display: none !important;
}
.list-filter label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.list-filter select {
  min-width: 120px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.list-filter select:focus {
  outline: none;
  border-color: var(--color-primary);
}
.list-filter--range .list-filter-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.list-filter-range input[type="date"] {
  flex: 1 1 9.5rem;
  min-width: 9.5rem;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  cursor: pointer;
  color-scheme: light;
}
[data-theme="dark"] .list-filter-range input[type="date"] {
  color-scheme: dark;
}
.list-filter-range input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1rem;
  height: 1rem;
}
.list-filter-range input[type="date"]:focus {
  outline: none;
  border-color: var(--color-primary);
}
.list-filter-range-sep {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.list-filter-clear {
  margin-bottom: 1px;
  white-space: nowrap;
}
.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  min-width: 42px;
  height: 100%;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.btn-filter-toggle svg {
  width: var(--icon-16);
  height: var(--icon-16);
  flex-shrink: 0;
}
.btn-filter-toggle-label {
  display: none;
}
.btn-filter-toggle:hover {
  color: var(--color-text);
  border-color: oklch(from var(--color-text) l c h / 0.2);
  background: var(--color-surface-2);
}
.btn-filter-toggle.is-active {
  color: var(--color-text);
  border-color: oklch(from var(--color-text) l c h / 0.2);
  background: var(--color-surface-2);
}
.btn-filter-toggle.has-filters {
  color: var(--color-primary);
  border-color: oklch(from var(--color-primary) l c h / 0.45);
}
.filter-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-inverse);
  background: var(--color-primary);
}
.filter-active-badge[hidden] {
  display: none !important;
}
.list-filter-clear[hidden] {
  display: none !important;
}
.list-filters-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.list-filters-panel[hidden] {
  display: none !important;
}
.list-filters-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.list-filter-builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.filter-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.filter-rule-field,
.filter-rule-value {
  flex: 1;
  min-width: 140px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.filter-rule-field:focus,
.filter-rule-value:focus {
  outline: none;
  border-color: var(--color-primary);
}
.filter-rule-remove {
  flex-shrink: 0;
}
.list-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.image-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.image-upload-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.image-upload-preview.has-image {
  padding: 4px;
}
.image-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.image-upload-preview.is-round {
  border-radius: 50%;
}
.image-upload-preview.is-round img {
  object-fit: cover;
  border-radius: 50%;
}
.image-upload-fallback {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-faint);
  text-align: center;
  padding: var(--space-2);
  line-height: 1.3;
}
.image-upload-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

/* Company logo slot: single square with inline upload or image + remove X */
.image-upload--logo-slot {
  display: block;
}
.image-upload-slot {
  position: relative;
  width: 176px;
  height: 176px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  overflow: hidden;
  flex-shrink: 0;
}
.image-upload-slot.has-image {
  border-style: solid;
}
#logo-preview.has-image {
  background: transparent;
}
.image-upload-slot.is-dragover .image-upload-pick,
.image-upload-pick:hover:not(:disabled) {
  border-color: oklch(from var(--color-primary) l c h / 0.55);
  border-style: solid;
  color: var(--color-text);
  background: oklch(from var(--color-primary) l c h / 0.06);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.1);
}
.image-upload-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  display: block;
  z-index: 1;
}
.image-upload-pick {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.image-upload-pick:hover:not(:disabled) {
  border-color: oklch(from var(--color-primary) l c h / 0.55);
  border-style: solid;
  color: var(--color-text);
  background: oklch(from var(--color-primary) l c h / 0.06);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.1);
}
.image-upload-pick:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.image-upload-pick svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.image-upload-pick span {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-align: center;
  max-width: 120px;
}
.image-upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.62);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.image-upload-remove:hover:not(:disabled) {
  background: rgba(15, 15, 15, 0.82);
}
.image-upload-remove svg {
  width: 12px;
  height: 12px;
}
.image-upload-remove[hidden] {
  display: none !important;
}

/* Identity layout: fields on the left, logo/photo on the right */
.client-identity-row,
.user-identity-row {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-4);
  align-items: stretch;
}
.client-identity-fields,
.user-identity-names {
  flex: 1 1 auto;
  min-width: 16.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.client-identity-fields .field,
.user-identity-names .field {
  margin: 0;
}
.client-identity-logo,
.user-identity-photo {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.client-identity-logo .image-upload--logo-slot,
.user-identity-photo .image-upload--logo-slot {
  margin-left: auto;
}
.user-identity-photo .image-upload-slot {
  width: 234px;
  height: 234px;
}
.user-identity-photo .image-upload-slot img {
  object-fit: cover;
  padding: 0;
  border-radius: var(--radius-sm);
}

.detail-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  object-fit: contain;
  display: block;
}
.detail-list .detail-identity-photo .detail-image {
  width: 234px;
  height: 234px;
  object-fit: cover;
}
.detail-image.is-round {
  border-radius: 50%;
  object-fit: cover;
}
.detail-image-empty {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.2);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: var(--space-3);
}
@media (min-width: 900px) {
  .btn-filter-toggle-label {
    display: inline;
  }
  .panel-header--list .list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Shared list page toolbar (Task / Clients / Users lists) */
.list-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.list-page-toolbar-left,
.list-page-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
}

.list-page-toolbar-right {
  margin-left: auto;
}

.list-page-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-btn);
  height: var(--icon-btn);
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.list-page-icon-btn:hover,
.list-page-icon-btn.is-active {
  color: var(--color-text);
  background: var(--color-surface-2);
  border-color: oklch(from var(--color-text) l c h / 0.2);
}

.list-page-icon-btn.has-filters {
  color: var(--color-primary);
  border-color: oklch(from var(--color-primary) l c h / 0.35);
}

.list-page-icon-btn svg {
  width: var(--icon-18);
  height: var(--icon-18);
}

.list-page-icon-btn .filter-active-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 9px;
  pointer-events: none;
}

.list-page-search-expand {
  flex: 0 0 0;
  width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: flex var(--transition), width var(--transition), max-width var(--transition), opacity var(--transition);
}

.list-page-search-expand.is-open {
  flex: 1 1 auto;
  width: auto;
  max-width: min(420px, 100%);
  opacity: 1;
  overflow: visible;
}

.list-page-search-expand .list-search {
  width: 100%;
  min-width: 180px;
}

.list-page-search-expand .list-search input {
  width: 100%;
}

/* Collapsible filters sidebar (Task / Clients / Users lists) */
.list-filter-layout {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
  --list-filter-sidebar-width: 300px;
}

.list-filter-layout > .admin-layout {
  flex: 1 1 0;
  min-width: 1000px;
}

.list-filter-sidebar-rail {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}

.list-filter-layout.is-filter-sidebar-collapsed .list-filter-sidebar-rail {
  flex: 0 0 24px;
}

.list-filter-sidebar-col {
  flex: 0 0 var(--list-filter-sidebar-width, 300px);
  min-width: 240px;
  max-width: 520px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-filter-layout.is-filter-sidebar-collapsed .list-filter-sidebar-col,
.list-filter-layout.is-filter-sidebar-collapsed .list-filter-resizer {
  display: none;
}

.list-filter-sidebar-tab {
  flex: 0 0 24px;
  width: 24px;
  align-self: stretch;
  border: none;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition), color var(--transition);
}

.list-filter-sidebar-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.list-filter-sidebar-tab svg {
  width: var(--icon-14);
  height: var(--icon-14);
  transition: transform var(--transition);
}

.list-filter-layout.is-filter-sidebar-collapsed .list-filter-sidebar-tab svg {
  transform: rotate(180deg);
}

.list-filter-sidebar {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.list-filter-sidebar .panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
  padding-top: var(--space-3);
}

.list-filter-count-line {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.list-filter-sidebar .list-filters-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.list-filter-sidebar .list-filters-panel[hidden] {
  display: none !important;
}

.list-filter-sidebar .list-filters {
  flex-direction: column;
  align-items: stretch;
}

.list-filter-sidebar .list-filter select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1600px) {
  .admin-page {
    padding: var(--space-3) var(--space-4);
  }
}

/* View mode uses the same form layout as edit, with read-only fields */
#user-form.is-view-mode .image-upload-pick,
#user-form.is-view-mode .image-upload-remove,
#client-form.is-view-mode .image-upload-pick,
#client-form.is-view-mode .image-upload-remove {
  display: none !important;
}

#user-form.is-view-mode .image-upload-slot:not(.has-image),
#client-form.is-view-mode .image-upload-slot:not(.has-image) {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

#user-form.is-view-mode .image-upload-slot:not(.has-image)::after {
  content: 'No photo';
}

#client-form.is-view-mode .image-upload-slot:not(.has-image)::after {
  content: 'No logo';
}

#user-form.is-view-mode input:disabled,
#user-form.is-view-mode select:disabled,
#user-form.is-view-mode textarea:disabled,
#client-form.is-view-mode input:disabled,
#client-form.is-view-mode select:disabled,
#client-form.is-view-mode textarea:disabled {
  opacity: 1;
  color: var(--color-text);
  -webkit-text-fill-color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
  cursor: default;
}
