#pageContent:has(.org-panel) { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.org-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
#organizationRoot { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }

.org-tabs { display: flex; flex: none; align-items: stretch; gap: 28px; height: 53px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.org-tabs admin-button { display: flex; align-items: center; border-bottom: 2px solid transparent; }
.org-tabs admin-button[aria-selected="true"] { border-bottom-color: var(--blue); }

.org-layout { display: grid; grid-template-columns: 192px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; min-width: 0; padding: 18px 20px 0; }
.org-department-tree { align-self: stretch; min-width: 0; min-height: 0; max-height: 100%; overflow: auto; padding: 9px; border: 1px solid var(--line); border-radius: 9px 9px 0 0; background: #fbfcfe; }
.org-tree-heading { padding: 8px 11px 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
.org-tree-list { display: flex; flex-direction: column; gap: 3px; }
.org-tree-option { display: block; width: 100%; padding: 2px 10px; border-radius: 6px; }
.org-tree-option[aria-current="true"] { background: #eaf0ff; }
.org-tree-option .el-button { justify-content: flex-start; width: 100%; }
.org-tree-option .el-button > span { flex: 1; min-width: 0; }
.org-tree-content { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.org-tree-content > span { min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.org-tree-option em { flex: none; margin-left: 8px; color: var(--muted); font-size: 12px; font-style: normal; }

.org-main, .org-departments { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.org-toolbar { display: flex; align-items: center; flex: none; flex-wrap: wrap; gap: 10px; min-height: 52px; padding: 0 0 14px; }
.org-toolbar .grow { flex: 1; }
.org-toolbar admin-search { width: clamp(190px, 18vw, 260px); }
.org-toolbar admin-select { width: 108px; flex: none; }
.org-toolbar .admin-filter-actions { display: flex; align-items: center; gap: 8px; }
.org-refresh-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.org-refresh-error { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex: none; margin: 12px 20px 0; padding: 8px 12px; border: 1px solid var(--el-color-danger-light-7); border-radius: 6px; background: var(--el-color-danger-light-9); color: var(--el-color-danger); font-size: 13px; overflow-wrap: anywhere; }
.org-departments { padding: 18px 20px 0; }
.org-section-meta { color: var(--muted); font-size: 13px; }
.org-main .table-wrap, .org-departments .table-wrap { flex: 1; min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.org-table { height: 100%; }
.org-table admin-table-cell small { display: block; margin-top: 3px; color: var(--muted); }
.org-account-id { display: block; overflow: hidden; color: #65748e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.org-scope { display: inline-block; max-width: 100%; overflow: hidden; padding: 4px 9px; border-radius: 5px; background: #edf3ff; color: #355db4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.org-cell-separator { margin: 0 3px; color: #b5bfd0; }
.org-row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.org-muted { color: var(--admin-text-tertiary); }
.org-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.org-status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ''; }
.org-status-enabled { color: #168a66; background: #eaf8f3; }
.org-status-disabled, .org-status-unassigned, .org-status-legacy { color: #748198; background: #f0f3f7; }
.org-status-frozen { color: #b66e1c; background: #fff5e6; }
.org-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 220px; justify-content: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.org-empty strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.org-empty-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 12px; background: var(--admin-color-primary-soft); color: var(--blue); font-size: 24px; line-height: 1; }
.org-list-footer { flex: none; min-height: 61px; padding: 0; }

.org-form { width: 100%; }
.org-dialog-body { display: flex; flex-direction: column; gap: 18px; }
.org-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.org-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.org-roster section { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 115px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; }
.org-scope-editor { display: flex; flex-direction: column; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; }
.org-scope-editor .sa-field { max-width: 270px; }
.org-scope-editor small { color: var(--muted); font-size: 12px; }
.org-scope-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 3px; }
.org-scope-option { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.org-scope-readonly { color: #355db4; font-size: 13px; }
.org-roster-picks { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.org-person-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px 3px 10px; border-radius: 999px; background: #edf2ff; color: #315bd5; font-size: 12px; }
.org-assignment-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.org-assignment-meta > div { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfe; }
.org-assignment-meta span { color: var(--muted); font-size: 12px; }
.org-assignment-meta b { font-size: 13px; }
.org-permission-section { display: flex; flex-direction: column; gap: 8px; }
.org-permission-section > admin-button { align-self: flex-start; }
.org-permissions { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 7px; }
.org-permissions-empty p { margin: 0; padding: 28px 14px; color: var(--muted); text-align: center; font-size: 13px; }
.org-permissions-summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
.org-permissions-summary strong { color: var(--ink); }
.org-permission-group { border-bottom: 1px solid var(--line); }
.org-permission-group:last-child { border-bottom: 0; }
.org-permission-group-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 13px; background: #f6f8fd; }
.org-permission-group-head strong { font-size: 13px; }
.org-permission-group.is-collapsed .org-group-pages { display: none; }
.org-group-pages { padding: 4px 14px 12px 31px; }
.org-permission-page { display: flex; flex-direction: column; gap: 7px; padding-left: 20px; }
.org-permission-parent, .org-permission-leaf { display: inline-flex; align-items: center; gap: 8px; }
.org-permission-leaves { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-left: 22px; }
.org-permission-leaf { min-width: 120px; }
.org-picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow: auto; padding: 4px; }
.org-picker-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; }
.org-picker-row[hidden] { display: none; }
.org-picker-row b, .org-picker-row small { display: block; }
.org-picker-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.org-picker-empty { padding: 32px 12px; color: var(--muted); text-align: center; }
.org-dialog-body .sa-help:empty { display: none; }

@media (max-width: 1440px) {
  .org-layout { display: flex; flex-direction: column; gap: 14px; }
  .org-department-tree { display: flex; align-items: center; align-self: stretch; gap: 12px; flex: none; max-height: none; overflow: visible; padding: 8px 12px; border-radius: 9px; }
  .org-tree-heading { flex: none; padding: 0; }
  .org-tree-list { flex-direction: row; gap: 8px; max-width: 100%; overflow-x: auto; }
  .org-tree-option { width: auto; white-space: nowrap; }
  .org-tree-option .el-button { width: auto; }
}
@media (max-width: 720px) {
  .org-tabs { gap: 12px; padding-inline: 16px; }
  .org-layout, .org-departments { padding-inline: 14px; }
  .org-toolbar admin-search { width: 100%; }
  .org-toolbar .grow { display: none; }
  .org-list-footer { align-items: flex-start; flex-direction: column; padding: 10px 0; }
  .org-form-grid, .org-roster { grid-template-columns: 1fr; }
  .org-scope-options { grid-template-columns: 1fr; }
  .org-assignment-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
