/* ==================== Base ==================== */
:root {
  --sidebar-width: 230px;
  --sidebar-width-collapsed: 60px;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #3565e6;
  --topbar-height: 56px;
  --primary: #3565e6;
  --primary-dark: #2a50b8;
  --bg-body: #f1f4f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-light: #e9edf4;
  --card-radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --page-section-gap: 24px;
  --toolbar-gap-top: 12px;
  --toolbar-gap-bottom: 18px;
  --page-section-gap-md: 18px;
  --toolbar-gap-top-md: 10px;
  --toolbar-gap-bottom-md: 14px;
  --page-section-gap-sm: 16px;
  --toolbar-gap-top-sm: 8px;
  --toolbar-gap-bottom-sm: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
}

/* ==================== Login ==================== */
.login-page {
  background: #f7f8fc;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper {
  display: flex;
  width: 100%;
  max-width: 1050px;
  min-height: 560px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  position: relative;
}

.login-left {
  flex: 1;
  position: relative;
  background: #f0f4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.iso-illustration {
  width: 70%;
  max-width: 400px;
  z-index: 2;
}

.iso-svg { width: 100%; height: auto; }

.deco-circle {
  position: absolute;
  border-radius: 50%;
  z-index: 1;
}

.deco-circle-green {
  width: 260px;
  height: 260px;
  background: rgba(134, 239, 172, 0.25);
  top: -40px;
  left: -60px;
}

.deco-shape {
  position: absolute;
  border-radius: 14px;
  z-index: 1;
}

.deco-shape-blue-1 {
  width: 80px; height: 50px;
  background: rgba(53, 101, 230, 0.12);
  top: 30px; right: 40px;
  transform: rotate(-12deg);
}

.deco-shape-blue-2 {
  width: 50px; height: 32px;
  background: rgba(53, 101, 230, 0.15);
  bottom: 60px; left: 40px;
  transform: rotate(20deg);
}

.deco-shape-green-1 {
  width: 40px; height: 40px;
  background: rgba(74, 222, 128, 0.2);
  bottom: 30px; right: 20px;
  transform: rotate(35deg);
}

.deco-shape-blue-3 {
  width: 60px; height: 38px;
  background: rgba(53, 101, 230, 0.1);
  top: 50%; left: 15px;
  transform: rotate(-8deg);
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.brand-hex {
  width: 48px;
  height: 48px;
  background: var(--primary);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-hex span {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-text {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e293b;
}

.login-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  border: none;
}

.field-error {
  display: none;
  color: #dc2626;
  font-size: 0.78rem;
  margin-top: 6px;
  line-height: 1.4;
}

.field-error.show {
  display: block;
}

.ui-toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.ui-toast {
  min-width: 240px;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.ui-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ui-toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

.ui-toast-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-primary);
}

.ui-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ui-toast-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.ui-toast-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ui-toast-close:hover {
  color: var(--text-primary);
}

.ui-toast-warn {
  border-left: 4px solid #f59e0b;
}

.ui-toast-warn .ui-toast-icon {
  color: #f59e0b;
}

.ui-toast-error {
  border-left: 4px solid #dc2626;
}

.ui-toast-error .ui-toast-icon {
  color: #dc2626;
}

.ui-toast-success {
  border-left: 4px solid #16a34a;
}

.ui-toast-success .ui-toast-icon {
  color: #16a34a;
}

.input-group-custom.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.input-group-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fff;
  transition: border-color 0.2s;
}

.input-group-custom:focus-within {
  border-color: var(--primary);
}

.input-group-custom i {
  color: #9ca3af;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.input-group-custom input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.95rem;
  color: #1e293b;
}

.input-group-custom input::placeholder {
  color: #9ca3af;
}

.login-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.btn-create {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  background: #fff;
  color: #6b7280;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-create:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.btn-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  border: none;
  border-radius: 24px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-login:hover {
  background: var(--primary-dark);
}

/* ==================== Sidebar ==================== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1050;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-hex-sm {
  width: 36px;
  height: 36px;
  background: var(--sidebar-active);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-hex-sm span {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.brand-text-sm {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  color: #e2e8f0;
  background: var(--sidebar-hover);
}

.sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-divider {
  padding: 16px 20px 6px;
}

.nav-divider span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.25);
}

/* ==================== Sidebar Directory ==================== */
.nav-directory {
  display: flex;
  flex-direction: column;
}

.nav-directory-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
  user-select: none;
}

.nav-directory-toggle:hover {
  color: #e2e8f0;
  background: var(--sidebar-hover);
}

.nav-directory-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-directory-toggle:not(.collapsed) .nav-directory-arrow {
  transform: rotate(180deg);
}

.nav-directory-children {
  padding: 0;
}

.nav-directory-children .nav-link {
  padding-left: 48px;
  font-size: 0.85rem;
}

.nav-directory-children .nav-link i {
  width: 16px;
  font-size: 0.85rem;
}

.nav-directory-children .nav-link.active {
  color: #fff;
  background: var(--sidebar-hover);
  border-left-color: var(--sidebar-active);
}

.nav-directory-toggle.collapsed ~ .nav-directory-children {
  display: none;
}

/* ==================== Sidebar Collapsed ==================== */
.sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
  transition: width 0.25s ease;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed .brand-text-sm {
  display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
  display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
  width: auto;
  font-size: 1.15rem;
}

.sidebar.collapsed .nav-divider {
  display: none;
}

.sidebar.collapsed .nav-directory-toggle .nav-directory-arrow {
  display: none;
}

.sidebar.collapsed .nav-directory-children {
  display: none !important;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

/* ==================== Topbar ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  background: #fff;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.toggle-sidebar-btn {
  text-decoration: none;
  font-size: 1.15rem;
  color: var(--text-secondary) !important;
  padding: 4px 6px;
  margin-right: 4px;
  transition: color 0.15s;
}

.toggle-sidebar-btn:hover {
  color: var(--text-primary) !important;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.separator-icon {
  font-size: 0.8rem;
}

.topbar-breadcrumb {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
}

.topbar-breadcrumb:hover {
  color: var(--primary);
}

.topbar-breadcrumb-link {
  color: inherit;
  text-decoration: none;
}

.topbar-breadcrumb-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  color: #94a3b8;
}

.topbar-page-title {
  font-weight: 600;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #64748b;
}

.topbar-user-avatar i {
  font-size: 1.1rem;
  line-height: 1;
}

.topbar-user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.topbar-username {
  display: inline-block;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-divider {
  width: 1px;
  height: 18px;
  flex-shrink: 0;
  background: #dbe3ef;
}

.topbar-menu-trigger {
  text-decoration: none;
  color: var(--text-secondary) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  box-shadow: none !important;
  line-height: 1;
}

.topbar-menu-trigger::after {
  display: none;
}

.topbar-menu-trigger .bi-three-dots-vertical {
  font-size: 1.1rem;
}

.topbar-menu-caret {
  font-size: 0.7rem;
  transform: translateY(1px);
}

.drawer-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 1200;
  display: none;
  justify-content: flex-end;
}

.drawer-panel-custom {
  width: min(460px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  outline: none;
}

.drawer-header-custom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-title-custom {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-subtitle-custom {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.drawer-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-section-subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.drawer-body-custom {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.drawer-footer-custom {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-light);
  background: #fff;
}

.personal-profile-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.personal-profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.personal-profile-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(53, 101, 230, 0.12), rgba(53, 101, 230, 0.2));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  overflow: hidden;
  border: 1px solid rgba(53, 101, 230, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.personal-profile-avatar:hover,
.personal-profile-avatar:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(53, 101, 230, 0.2);
  border-color: rgba(53, 101, 230, 0.32);
}

.personal-profile-avatar.is-filled {
  cursor: default;
}

.personal-profile-avatar.is-uploading {
  cursor: progress;
}

.personal-profile-avatar.is-uploading:hover,
.personal-profile-avatar.is-uploading:focus-within {
  transform: none;
}

.personal-profile-avatar-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.personal-profile-avatar.is-empty .personal-profile-avatar-media {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.5), rgba(53, 101, 230, 0.05));
}

.personal-profile-avatar.is-empty .personal-profile-avatar-media i {
  opacity: 0.72;
  transition: opacity 0.18s ease;
}

.personal-profile-avatar.is-empty:hover .personal-profile-avatar-media i,
.personal-profile-avatar.is-empty:focus-within .personal-profile-avatar-media i {
  opacity: 0.22;
}

.personal-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.personal-profile-avatar.is-filled .personal-profile-avatar-media img {
  transition: transform 0.22s ease;
}

.personal-profile-avatar.is-filled:hover .personal-profile-avatar-media img,
.personal-profile-avatar.is-filled:focus-within .personal-profile-avatar-media img {
  transform: scale(1.05);
}

.personal-profile-avatar.is-uploading .personal-profile-avatar-media img,
.personal-profile-avatar.is-uploading .personal-profile-avatar-media i {
  filter: saturate(0.88);
}

.personal-profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.personal-profile-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.55));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.personal-profile-avatar.is-filled::after {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.58));
}

.personal-profile-avatar.is-uploading::after {
  background: rgba(15, 23, 42, 0.62);
  opacity: 1;
}

.personal-profile-avatar-action,
.personal-profile-avatar-empty-upload {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  pointer-events: auto;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.personal-profile-avatar-action {
  width: 34px;
  height: 34px;
}

.personal-profile-avatar-empty-upload {
  width: 38px;
  height: 38px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 16px 34px rgba(53, 101, 230, 0.26);
}

.personal-profile-avatar-action i,
.personal-profile-avatar-empty-upload i {
  font-size: 1rem;
}

.personal-profile-avatar-action:hover,
.personal-profile-avatar-action:focus-visible,
.personal-profile-avatar-empty-upload:hover,
.personal-profile-avatar-empty-upload:focus-visible {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.26);
  transform: translateY(-1px) scale(1.04);
}

.personal-profile-avatar-action:disabled,
.personal-profile-avatar-empty-upload:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.personal-profile-avatar-action-preview {
  left: 10px;
  transform: translateX(-8px) scale(0.84);
}

.personal-profile-avatar-action-upload {
  right: 10px;
  transform: translateX(8px) scale(0.84);
}

.personal-profile-avatar.is-empty .personal-profile-avatar-action {
  display: none;
}

.personal-profile-avatar.is-empty:hover .personal-profile-avatar-action,
.personal-profile-avatar.is-empty:focus-within .personal-profile-avatar-action {
  display: inline-flex;
}

.personal-profile-avatar-action,
.personal-profile-avatar.is-empty:hover .personal-profile-avatar-empty-upload,
.personal-profile-avatar.is-empty:focus-within .personal-profile-avatar-empty-upload,
.personal-profile-avatar.is-filled .personal-profile-avatar-empty-upload {
  opacity: 0;
  visibility: hidden;
}

.personal-profile-avatar.is-empty .personal-profile-avatar-empty-upload {
  opacity: 1;
  visibility: visible;
}

.personal-profile-avatar:hover::after,
.personal-profile-avatar:focus-within::after {
  opacity: 1;
}

.personal-profile-avatar:hover .personal-profile-avatar-action,
.personal-profile-avatar:focus-within .personal-profile-avatar-action {
  opacity: 1;
  visibility: visible;
}

.personal-profile-avatar:hover .personal-profile-avatar-action-preview,
.personal-profile-avatar:focus-within .personal-profile-avatar-action-preview {
  transform: translateX(0) scale(1);
}

.personal-profile-avatar:hover .personal-profile-avatar-action-upload,
.personal-profile-avatar:focus-within .personal-profile-avatar-action-upload {
  transform: translateX(0) scale(1);
}

.personal-profile-avatar.is-filled:hover .personal-profile-avatar-empty-upload,
.personal-profile-avatar.is-filled:focus-within .personal-profile-avatar-empty-upload {
  opacity: 0;
  visibility: hidden;
}

.personal-profile-avatar.is-empty:hover .personal-profile-avatar-empty-upload,
.personal-profile-avatar.is-empty:focus-within .personal-profile-avatar-empty-upload {
  transform: translate(-50%, -50%) scale(0.86);
}

.personal-profile-avatar.is-empty .personal-profile-avatar-empty-upload:hover,
.personal-profile-avatar.is-empty .personal-profile-avatar-empty-upload:focus-visible {
  transform: translate(-50%, -50%) scale(1.04);
}

.personal-profile-avatar.is-empty .personal-profile-avatar-overlay {
  pointer-events: auto;
}

.personal-profile-avatar.is-filled .personal-profile-avatar-overlay {
  pointer-events: none;
}

.personal-profile-avatar.is-filled:hover .personal-profile-avatar-overlay,
.personal-profile-avatar.is-filled:focus-within .personal-profile-avatar-overlay {
  pointer-events: auto;
}

.personal-profile-avatar.is-uploading .personal-profile-avatar-overlay,
.personal-profile-avatar.is-uploading .personal-profile-avatar-action,
.personal-profile-avatar.is-uploading .personal-profile-avatar-empty-upload {
  pointer-events: none;
}

.personal-profile-avatar.is-uploading .personal-profile-avatar-action,
.personal-profile-avatar.is-uploading .personal-profile-avatar-empty-upload {
  opacity: 0.72;
  visibility: visible;
}

.personal-profile-avatar-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.personal-password-display-group {
  margin-top: -2px;
}

.personal-password-display-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background: #fff;
}

.personal-password-mask {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.personal-password-change-link {
  padding: 0;
  border: none;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}

.personal-password-change-link:hover,
.personal-password-change-link:focus,
.personal-password-change-link:focus-visible {
  text-decoration: underline;
  outline: none;
  box-shadow: none;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

.page-table-layout,
.table-area-card,
.table-area-body,
.table-area-footer,
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.page-table-layout {
  overflow-x: hidden;
}

.table-area-card {
  overflow: hidden;
}

.table-area-body {
  overflow-x: hidden;
}

.table-area-footer {
  overflow: hidden;
}

.page-table-layout > .query-toolbar-card,
.page-table-layout > .table-toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.page-table-layout > .query-toolbar-card .card-body,
.page-table-layout > .table-toolbar .table-toolbar-actions,
.page-table-layout > .query-toolbar-card .query-toolbar-shell,
.page-table-layout > .query-toolbar-card .query-toolbar-fields,
.page-table-layout > .query-toolbar-card .query-toolbar-actions {
  min-width: 0;
  max-width: 100%;
}

.page-table-layout > .query-toolbar-card .query-toolbar-actions {
  flex-shrink: 0;
}

.page-table-layout > .query-toolbar-card .query-toolbar-item {
  flex: 0 0 auto;
}

.page-table-layout > .query-toolbar-card .query-toolbar-control,
.page-table-layout > .query-toolbar-card .query-toolbar-control .form-control,
.page-table-layout > .query-toolbar-card .query-toolbar-control .form-control-sm,
.page-table-layout > .query-toolbar-card .query-toolbar-control .form-select,
.page-table-layout > .query-toolbar-card .query-toolbar-control .form-select-sm {
  max-width: 100%;
}

.page-table-layout > .query-toolbar-card .query-toolbar-shell {
  overflow-x: hidden;
}

.page-table-layout > .query-toolbar-card .query-toolbar-fields {
  overflow: visible;
}

.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar {
  height: 0;
}

.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar-thumb,
.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar-track {
  background: transparent;
}

.page-table-layout > .table-toolbar .table-toolbar-actions {
  overflow: visible;
}

.page-table-layout > .table-area-card .card-footer,
.page-table-layout > .table-area-card .card-footer > * {
  min-width: 0;
  max-width: 100%;
}

.page-table-layout > .table-area-card .pagination-bar {
  flex-wrap: wrap;
}

.page-table-layout > .table-area-card .table-responsive
.page-table-layout > .table-area-card .data-table {
  width: max-content;
  min-width: 100%;
}

.page-table-layout > .table-area-card .table-responsive {
  display: block;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.page-table-layout > .table-area-card .table-responsive > .data-table {
  margin-bottom: 0;
}

.page-table-layout > .table-area-card .table-responsive::-webkit-scrollbar,
.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar {
  height: 8px;
}

.page-table-layout > .table-area-card .table-responsive::-webkit-scrollbar-thumb,
.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.page-table-layout > .table-area-card .table-responsive::-webkit-scrollbar-track,
.page-table-layout > .query-toolbar-card .query-toolbar-fields::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.5);
}

.page-table-layout > .table-area-card .data-table th,
.page-table-layout > .table-area-card .data-table td {
  white-space: nowrap;
}

.page-table-layout > .table-area-card .data-table .col-action {
  position: sticky;
  right: 0;
}

@media (max-width: 576px) {
  .page-table-layout > .query-toolbar-card .query-toolbar-fields {
    flex-wrap: wrap;
  }
}

.content > :first-child {
  margin-top: 0 !important;
}

.content > :last-child {
  margin-bottom: 0 !important;
}

.page-section {
  margin-bottom: var(--page-section-gap);
}

.page-section:first-child {
  margin-top: 0;
}

.page-section:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .content {
    padding: 18px;
  }

  .page-section {
    margin-bottom: var(--page-section-gap-md);
  }
}

@media (max-width: 576px) {
  .content {
    padding: 16px;
  }

  .page-section {
    margin-bottom: var(--page-section-gap-sm);
  }
}

/* ==================== Dashboard ==================== */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: rgba(53, 101, 230, 0.1);
  color: #3565e6;
}

.stat-icon-green {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.stat-icon-orange {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.stat-icon-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.stat-icon-red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-card-body {
  flex: 1;
  min-width: 0;
}

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==================== Cards ==================== */
.dashboard-card,
.data-card {
  background: #fff;
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.dashboard-card .card-header,
.data-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
}

.dashboard-card .card-header h5,
.data-card .card-header h5 {
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-card .card-body {
  padding: 20px;
}

.mini-stat-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  height: 100%;
}

.mini-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.mini-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-notice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-notice-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.dashboard-notice-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dashboard-notice-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-notice-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
/* ==================== Data Tables ==================== */
.data-table {
  font-size: 0.88rem;
}

.data-table thead th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table .col-check {
  width: 40px;
  text-align: center;
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 2;
}

.data-table tbody .col-check {
  background: #fff;
}

.data-table tbody tr:hover .col-check {
  background: #f8fafc;
}

.data-table .col-action {
  width: 140px;
  text-align: center;
  position: sticky;
  right: 0;
  background: #f8fafc;
  z-index: 2;
}

.data-table tbody .col-action {
  background: #fff;
}

.data-table tbody tr:hover .col-action {
  background: #f8fafc;
}

/* ==================== Pagination ==================== */
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-bar .page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pagination-bar .page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-bar .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-bar .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-size-select {
  width: 72px;
  font-size: 0.82rem;
  padding: 4px 6px;
  border-color: var(--border-light);
  border-radius: 6px;
}

.data-table code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--primary);
}

.fw-medium {
  font-weight: 500;
}

/* ==================== Search Form ==================== */
.query-toolbar-card {
  border-radius: 14px;
}

.query-toolbar-card .card-body {
  padding: 18px 20px;
}

.query-toolbar-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}

.query-toolbar-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.query-toolbar-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.query-toolbar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.query-toolbar-control {
  min-width: 0;
}

.query-toolbar-control .form-control-sm,
.query-toolbar-control .form-select-sm,
.query-toolbar-control .form-control,
.query-toolbar-control .form-select {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-color: var(--border-light);
  min-width: 140px;
}

.query-toolbar-control .form-control-sm:focus,
.query-toolbar-control .form-select-sm:focus,
.query-toolbar-control .form-control:focus,
.query-toolbar-control .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(53, 101, 230, 0.1);
}

.query-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.table-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  flex-direction: row-reverse;
  gap: 10px;
}

.table-toolbar .btn {
  min-width: 88px;
}

.export-action-dropdown .btn {
  min-width: 88px;
}

.export-action-dropdown .dropdown-menu {
  min-width: 132px;
}

.export-action-dropdown .dropdown-item {
  font-size: 0.84rem;
}

.query-toolbar-card.page-section {
  margin-bottom: var(--toolbar-gap-top);
}

.table-toolbar.page-section {
  margin-bottom: var(--toolbar-gap-bottom);
}

@media (max-width: 992px) {
  .query-toolbar-shell {
    gap: 12px 16px;
  }

  .query-toolbar-fields {
    gap: 10px 14px;
  }
}

@media (max-width: 768px) {
  .query-toolbar-card .card-body {
    padding: 16px 16px 14px;
  }

  .query-toolbar-shell {
    gap: 12px;
  }

  .query-toolbar-actions {
    flex: 1 0 100%;
    width: 100%;
  }

  .table-toolbar-actions {
    gap: 8px;
  }

  .query-toolbar-card.page-section {
    margin-bottom: var(--toolbar-gap-top-md);
  }

  .table-toolbar.page-section {
    margin-bottom: var(--toolbar-gap-bottom-md);
  }
}

@media (max-width: 576px) {
  .query-toolbar-item {
    width: 100%;
    justify-content: space-between;
  }

  .query-toolbar-control {
    flex: 1;
  }

  .query-toolbar-control .form-control-sm,
  .query-toolbar-control .form-select-sm,
  .query-toolbar-control .form-control,
  .query-toolbar-control .form-select {
    width: 100% !important;
    min-width: 0;
  }

  .query-toolbar-card.page-section {
    margin-bottom: var(--toolbar-gap-top-sm);
  }

  .table-toolbar.page-section {
    margin-bottom: var(--toolbar-gap-bottom-sm);
  }
}

/* ==================== Operation Buttons ==================== */
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
  position: relative;
  min-height: 22px;
  z-index: 1;
}

.table-actions.table-action-open {
  z-index: 1095;
}

.table-action-link {
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table-action-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.table-action-link-danger {
  color: #ef4444;
}

.table-action-link-danger:hover {
  color: #dc2626;
}

.table-action-link:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}

.table-action-icon {
  font-size: 0.82rem;
  line-height: 1;
  flex-shrink: 0;
}

.table-action-label {
  white-space: nowrap;
}

.table-action-more-toggle .table-action-icon {
  font-size: 0.88rem;
  margin-right: 1px;
}

.table-action-more {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.table-action-more.table-action-open {
  z-index: 1096;
}

.table-action-more-toggle {
  color: var(--text-secondary);
  padding-right: 0;
}

.table-action-more-toggle:hover,
.table-action-more-toggle.show {
  color: var(--primary);
}

.table-action-more-toggle::after {
  display: none;
}

.table-action-dropdown-menu {
  min-width: 132px;
  max-width: 220px;
  padding: 6px 0;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1080;
}

.table-action-dropdown-menu.show {
  animation: fadeInActionMenu 0.12s ease-out;
}

.table-action-menu-item {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.table-action-dropdown-menu .table-action-menu-item:hover,
.table-action-dropdown-menu .table-action-menu-item:focus,
.table-action-dropdown-menu .table-action-menu-item:focus-visible {
  background: #f8fafc;
  color: var(--primary);
}

.table-action-dropdown-menu .table-action-menu-item:active {
  background: #eef2ff;
  color: var(--primary);
}

.table-action-menu-divider {
  margin: 6px 0;
  border-top-color: var(--border-light);
}

.table-action-menu-header {
  padding: 4px 14px 2px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #fb923c;
}

.table-action-menu-item-danger {
  color: #ef4444;
  font-weight: 600;
}

.table-action-dropdown-menu .table-action-menu-item-danger:hover,
.table-action-dropdown-menu .table-action-menu-item-danger:focus,
.table-action-dropdown-menu .table-action-menu-item-danger:focus-visible {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.table-action-dropdown-menu .table-action-menu-item-danger:active {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.table-action-menu-item:disabled,
.table-action-menu-item-danger:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  background: transparent;
}

.data-table .col-action {
  width: 168px;
  min-width: 168px;
  text-align: center;
  position: sticky;
  right: 0;
  background: #f8fafc;
  z-index: 3;
  overflow: visible;
}

.data-table .col-action.table-action-cell-open {
  z-index: 1094;
}

.data-table thead .col-action {
  text-align: center;
}

.data-table tbody .col-action {
  background: #fff;
  overflow: visible;
}

.data-table tbody tr:hover .col-action {
  background: #f8fafc;
}

.data-table .col-action .table-actions {
  width: 100%;
  justify-content: center;
  overflow: visible;
}

.data-card .card-body.p-0 {
  overflow: visible;
}

.data-card .table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.data-table .col-action,
.data-table .col-action .table-actions,
.data-table .col-action .table-action-more {
  overflow: visible;
}

/* 操作列宽度以“详情 / 编辑 / 更多”三项组合为基准，非必要不要继续放大。 */

@keyframes fadeInActionMenu {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 992px) {
  .data-table .col-action {
    width: 156px;
    min-width: 156px;
  }

  .table-actions {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .data-table .col-action {
    width: 132px;
    min-width: 132px;
  }

  .table-actions {
    gap: 6px;
  }

  .table-action-link,
  .table-action-more-toggle {
    font-size: 0.82rem;
  }

  .table-action-link .table-action-label {
    display: none;
  }

  .table-action-link .table-action-icon {
    font-size: 1rem;
  }

  .table-action-more-toggle .table-action-label {
    display: inline;
  }
}

@media (max-width: 576px) {
  .table-action-dropdown-menu {
    min-width: 124px;
    max-width: min(220px, calc(100vw - 24px));
  }
}

/* ==================== Table Empty State ==================== */
.table-empty-guide-cell {
  padding: 0 !important;
}

.table-empty-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 12px;
}

.table-empty-guide-illustration {
  opacity: 0.6;
}

.table-empty-svg {
  width: 80px;
  height: 80px;
}

.table-empty-guide-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.table-empty-guide-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: -6px;
}

.table-empty-guide-create-btn {
  margin-top: 8px;
}


/* ==================== Checkbox ==================== */
.checkbox-column {
  width: 40px;
  text-align: center;
}

.form-check-input-table {
  cursor: pointer;
  width: 16px;
  height: 16px;
  border-color: #cbd5e1;
  margin: 0;
}

.form-check-input-table:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ==================== Quick Actions ==================== */
.quick-action-link {
  text-decoration: none;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.2s;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
}

.quick-action:hover {
  background: #eef2ff;
  color: var(--primary);
  transform: translateY(-1px);
}

.quick-action i {
  font-size: 1.2rem;
  color: var(--primary);
}

.info-table td {
  padding: 8px 0;
  font-size: 0.85rem;
}

/* ==================== Badges ==================== */
.badge-active {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-inactive {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-primary {
  background: rgba(53, 101, 230, 0.1);
  color: var(--primary);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-info {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.badge-secondary {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}

/* ==================== Tree Table ==================== */
.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  margin-right: 2px;
}

.tree-toggle:hover {
  color: var(--primary);
  background: rgba(53, 101, 230, 0.06);
}

.tree-toggle i {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.tree-toggle-expanded i {
  transform: rotate(90deg);
}

.tree-toggle-placeholder {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 2px;
}

.tree-name-cell {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tree-highlight {
  background: #fffbeb !important;
}

/* ==================== Modal ==================== */
 .modal-open {
  overflow: hidden;
}

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.18s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog-custom {
  --dialog-width: 560px;
  --dialog-height: auto;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  width: min(var(--dialog-width), 92vw);
  height: var(--dialog-height);
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.18s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(-14px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.dialog-size-confirm {
  --dialog-width: 400px;
  --dialog-height: 240px;
}

.dialog-size-detail {
  --dialog-width: 560px;
  --dialog-height: 520px;
}

.dialog-size-form {
  --dialog-width: 620px;
  --dialog-height: 640px;
}

.dialog-size-authorize {
  --dialog-width: 800px;
  --dialog-height: 680px;
}

.modal-header-custom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.modal-header-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-header-custom h5 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  margin: 0;
}

.modal-header-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(53, 101, 230, 0.1);
}

.modal-body-custom {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.dialog-form .modal-body-custom,
.dialog-authorize .modal-body-custom {
  padding-top: 20px;
}

.dialog-detail .modal-body-custom {
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
}

.dialog-confirm .modal-body-custom {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-footer-custom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 18px;
  border-top: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(248, 250, 252, 0.72);
}

.modal-footer-custom .btn {
  min-width: 88px;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none;
}

.personal-avatar-preview-modal {
  z-index: 1320;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.3), rgba(2, 6, 23, 0.9));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: personalAvatarPreviewFadeIn 0.2s ease;
}

@keyframes personalAvatarPreviewFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.personal-avatar-preview-dialog {
  --dialog-width: min(920px, 94vw);
  position: relative;
  width: min(920px, 94vw);
  max-width: 94vw;
  max-height: 94vh;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
  box-shadow: 0 36px 80px rgba(2, 6, 23, 0.42);
  animation: personalAvatarPreviewZoomIn 0.22s ease;
}

@keyframes personalAvatarPreviewZoomIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.personal-avatar-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.personal-avatar-preview-close:hover,
.personal-avatar-preview-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.personal-avatar-preview-toolbar {
  position: absolute;
  top: 14px;
  right: 66px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.personal-avatar-preview-tool {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.18s ease;
}

.personal-avatar-preview-tool:hover,
.personal-avatar-preview-tool:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.personal-avatar-preview-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.personal-avatar-preview-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.personal-avatar-preview-body img {
  display: block;
  max-width: min(820px, 86vw);
  max-height: calc(94vh - 56px);
  border-radius: 20px;
  object-fit: contain;
  box-shadow: 0 32px 72px rgba(2, 6, 23, 0.46);
  transition: transform 0.2s ease;
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  will-change: transform;
}

.personal-avatar-preview-body::before {
  content: '';
  position: absolute;
  inset: 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.personal-avatar-preview-body > img {
  position: relative;
  z-index: 1;
}

.personal-avatar-preview-body.is-zoomed {
  position: relative;
  overflow: auto;
  padding: 18px;
  max-height: calc(94vh - 90px);
  border-radius: 22px;
  scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

.personal-avatar-preview-body.is-zoomed::before {
  inset: 18px;
}

.personal-avatar-preview-body.is-zoomed::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.personal-avatar-preview-body.is-zoomed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.personal-avatar-preview-body.is-zoomed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.personal-avatar-preview-body.is-zoomed::after {
  content: '滚轮缩放 · 按住拖拽查看';
  position: absolute;
  right: 20px;
  bottom: 20px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.82);
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
}

.personal-avatar-preview-body.is-draggable {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.personal-avatar-preview-body.is-draggable img,
.personal-avatar-preview-body.is-zoomed img {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  max-width: none;
  max-height: none;
}

.personal-avatar-preview-body.is-dragging,
.personal-avatar-preview-body.is-dragging img,
.personal-avatar-preview-body.is-zoomed.is-dragging img {
  cursor: grabbing;
}

.personal-avatar-preview-body.is-dragging img {
  transition: none;
}

.personal-avatar-preview-body.is-draggable::after {
  transition: opacity 0.18s ease;
}

.personal-avatar-preview-body.is-zoomed:not(.is-dragging)::after {
  opacity: 0.78;
}

.personal-avatar-preview-body.is-zoomed:hover::after,
.personal-avatar-preview-body.is-draggable.is-dragging::after {
  opacity: 1;
}

.personal-avatar-preview-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.78);
}

.personal-avatar-preview-tip i {
  opacity: 0.8;
}

.personal-avatar-action-sheet-modal {
  align-items: flex-end;
  padding: 16px;
  background: rgba(2, 6, 23, 0.52);
}

.personal-avatar-action-sheet-dialog {
  --dialog-width: min(100%, 420px);
  width: min(100%, 420px);
  max-width: 100%;
  border-radius: 22px 22px 18px 18px;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
  animation: personalAvatarSheetSlideUp 0.2s ease;
}

@keyframes personalAvatarSheetSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.personal-avatar-action-sheet-title {
  margin-bottom: 12px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.personal-avatar-action-sheet-item,
.personal-avatar-action-sheet-cancel {
  width: 100%;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: all 0.18s ease;
}

.personal-avatar-action-sheet-item + .personal-avatar-action-sheet-item,
.personal-avatar-action-sheet-item + .personal-avatar-action-sheet-cancel {
  margin-top: 10px;
}

.personal-avatar-action-sheet-cancel {
  justify-content: center;
  margin-top: 12px;
  font-weight: 600;
  background: rgba(241, 245, 249, 0.96);
}

.personal-avatar-action-sheet-item:hover,
.personal-avatar-action-sheet-item:focus-visible,
.personal-avatar-action-sheet-cancel:hover,
.personal-avatar-action-sheet-cancel:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.personal-avatar-action-sheet-item.is-disabled,
.personal-avatar-action-sheet-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.personal-avatar-action-sheet-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(53, 101, 230, 0.1);
  color: var(--primary);
  flex-shrink: 0;
}

.personal-avatar-action-sheet-icon i {
  font-size: 1rem;
}

@media (min-width: 577px) {
  .personal-avatar-action-sheet-modal {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    font-size: 0.74rem;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-filled .personal-profile-avatar-overlay,
  .personal-profile-avatar.is-empty .personal-profile-avatar-overlay {
    pointer-events: none;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar::after,
  .personal-profile-avatar .personal-profile-avatar-action,
  .personal-profile-avatar .personal-profile-avatar-empty-upload {
    display: none;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar {
    box-shadow: 0 12px 26px rgba(53, 101, 230, 0.14);
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar:active {
    transform: scale(0.98);
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-uploading:active {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar:hover,
  .personal-profile-avatar:focus-within {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-uploading::after {
    display: block;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-empty .personal-profile-avatar-media i,
  .personal-profile-avatar.is-empty:hover .personal-profile-avatar-media i,
  .personal-profile-avatar.is-empty:focus-within .personal-profile-avatar-media i {
    opacity: 0.72;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-filled .personal-profile-avatar-media img,
  .personal-profile-avatar.is-filled:hover .personal-profile-avatar-media img,
  .personal-profile-avatar.is-filled:focus-within .personal-profile-avatar-media img {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-uploading .personal-profile-avatar-media img,
  .personal-profile-avatar.is-uploading .personal-profile-avatar-media i {
    filter: saturate(0.88);
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-filled {
    cursor: pointer;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-uploading {
    cursor: progress;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-empty {
    cursor: pointer;
  }
}

@media (max-width: 576px) {
  .personal-profile-avatar.is-uploading .personal-profile-avatar-media {
    opacity: 0.92;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body::before {
    inset: 20px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body img:hover {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body img {
    max-width: calc(100vw - 48px);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body {
    min-height: 280px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog::after {
    content: '头像预览 · Esc 可关闭';
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    content: '';
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-close {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    max-height: 92vh;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-modal {
    padding: 14px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item,
  .personal-avatar-action-sheet-cancel {
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-title {
    margin-bottom: 10px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item.is-disabled:hover,
  .personal-avatar-action-sheet-item:disabled:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item.is-disabled .personal-avatar-action-sheet-icon,
  .personal-avatar-action-sheet-item:disabled .personal-avatar-action-sheet-icon {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(100, 116, 139, 0.88);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    border-radius: 20px 20px 16px 16px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-modal {
    padding: 12px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item,
  .personal-avatar-action-sheet-cancel {
    min-height: 52px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip i {
    display: inline-block;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    opacity: 0.88;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog::before {
    opacity: 0.8;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog::after {
    letter-spacing: 0.04em;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body > img {
    z-index: 1;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body {
    position: relative;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    margin-top: 10px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item span:last-child {
    font-weight: 500;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-cancel {
    font-weight: 700;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item {
    background: rgba(255, 255, 255, 0.98);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-cancel {
    background: rgba(248, 250, 252, 0.98);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item:active,
  .personal-avatar-action-sheet-cancel:active {
    transform: scale(0.99);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item.is-disabled:active,
  .personal-avatar-action-sheet-item:disabled:active {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-icon {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-icon i {
    font-size: 1.02rem;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-close i {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    width: min(100%, 94vw);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body img {
    border-radius: 16px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body::before {
    border-radius: 18px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-title {
    font-size: 0.86rem;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item,
  .personal-avatar-action-sheet-cancel {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item:hover,
  .personal-avatar-action-sheet-item:focus-visible,
  .personal-avatar-action-sheet-cancel:hover,
  .personal-avatar-action-sheet-cancel:focus-visible {
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog::after,
  .personal-avatar-preview-dialog::before {
    z-index: 1;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-close {
    z-index: 2;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    position: relative;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.5);
    transform: translateX(-50%);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-title {
    margin-top: 10px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item,
  .personal-avatar-action-sheet-cancel {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    overflow: hidden;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-modal {
    align-items: center;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    padding-top: 22px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    padding: 0 8px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body img {
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.42);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-close:hover,
  .personal-avatar-preview-close:focus-visible {
    transform: none;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-title,
  .personal-avatar-preview-tip {
    user-select: none;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-modal[style*='display: none'] {
    padding: 0;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-modal[style*='display: none'] {
    padding: 0;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-modal,
  .personal-avatar-preview-modal {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    margin-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    margin-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-cancel {
    margin-bottom: 2px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-close {
    margin-top: 0;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item span:last-child,
  .personal-avatar-action-sheet-cancel {
    letter-spacing: 0.01em;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog::after {
    font-size: 0.78rem;
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    line-height: 1.5;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item {
    line-height: 1.2;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-tip {
    margin-bottom: 2px;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-title {
    color: var(--text-secondary);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item span:last-child {
    color: var(--text-primary);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-item.is-disabled span:last-child,
  .personal-avatar-action-sheet-item:disabled span:last-child {
    color: #94a3b8;
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-cancel {
    color: var(--text-primary);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body img {
    background: rgba(255, 255, 255, 0.02);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-body::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    border-color: rgba(255, 255, 255, 0.14);
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-dialog {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.99));
  }
}

@media (max-width: 576px) {
  .personal-avatar-action-sheet-modal {
    background: rgba(2, 6, 23, 0.58);
  }
}

@media (max-width: 576px) {
  .personal-avatar-preview-modal {
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.28), rgba(2, 6, 23, 0.92));
  }
}

.personal-avatar-preview-dialog::after {
  content: '头像预览';
  position: absolute;
  left: 24px;
  top: 18px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.personal-avatar-preview-dialog::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: 46px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.personal-avatar-preview-body {
  position: relative;
}

.personal-avatar-preview-body img:hover {
  transform: scale(1.01);
}

.personal-avatar-preview-body img {
  transition: transform 0.2s ease;
}

@media (max-width: 576px) {
  .personal-avatar-preview-dialog {
    padding: 20px;
    border-radius: 22px;
  }

  .personal-avatar-preview-dialog::after {
    left: 18px;
    top: 14px;
  }

  .personal-avatar-preview-dialog::before {
    left: 18px;
    right: 18px;
    top: 40px;
  }

  .personal-avatar-preview-close {
    top: 12px;
    right: 12px;
  }

  .personal-avatar-preview-toolbar {
    top: 12px;
    right: 58px;
    gap: 8px;
  }

  .personal-avatar-preview-tool {
    width: 34px;
    height: 34px;
  }

  .personal-avatar-preview-body::before {
    inset: 20px;
  }

  .personal-avatar-preview-body.is-zoomed {
    padding: 14px;
  }

  .personal-avatar-preview-body.is-zoomed::after {
    right: 14px;
    bottom: 14px;
    font-size: 0.68rem;
  }
}

.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-group:last-child {
  margin-bottom: 0;
}

.modal-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-form-group .form-control,
.modal-form-group .form-select {
  font-size: 0.86rem;
  min-height: 40px;
  padding: 8px 12px;
  border-color: rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  width: 100%;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.modal-form-group .form-control:hover,
.modal-form-group .form-select:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

.modal-form-group .form-control:focus,
.modal-form-group .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53, 101, 230, 0.12);
  outline: none;
}

.modal-form-group .form-control:disabled,
.modal-form-group .form-select:disabled {
  background: #f8fafc;
  color: var(--text-primary);
  cursor: not-allowed;
  -webkit-text-fill-color: var(--text-primary);
  opacity: 1;
}

.dialog-detail .modal-form-group {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.78);
}

.dialog-detail .modal-form-group label {
  margin-bottom: 4px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.dialog-detail .modal-form-group .form-control,
.dialog-detail .modal-form-group .form-select {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

.dialog-detail .modal-form-group .form-control:disabled,
.dialog-detail .modal-form-group .form-select:disabled {
  background: transparent;
}

.modal-form-group .form-control.is-invalid,
.modal-form-group .form-select.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.modal-body-custom .text-danger {
  font-size: 0.8rem;
  margin-top: 4px;
}

.modal-confirm-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-confirm-icon {
  font-size: 2.5rem;
  color: #f59e0b;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .modal-backdrop-custom {
    padding: 16px;
  }

  .modal-dialog-custom {
    width: min(var(--dialog-width), 100%);
    max-height: 92vh;
  }

  .dialog-size-form,
  .dialog-size-detail,
  .dialog-size-authorize {
    --dialog-height: auto;
  }

  .modal-header-custom,
  .modal-body-custom,
  .modal-footer-custom {
    padding-left: 18px;
    padding-right: 18px;
  }
}


/* ==================== Select & Switch ==================== */
.ui-switch-field {
  display: flex;
  align-items: center;
  min-height: 26px;
}

.ui-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  line-height: 0;
  position: relative;
}

.ui-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ui-switch-slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 999px #cbd5e1;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.ui-switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.ui-switch:hover .ui-switch-slider {
  opacity: 0.98;
}

.ui-switch.is-checked .ui-switch-slider,
.ui-switch-input:checked + .ui-switch-slider,
.ui-switch:has(.ui-switch-input:checked) .ui-switch-slider {
  background: #22c55e;
  box-shadow: inset 0 0 0 999px #22c55e;
}

.ui-switch.is-checked .ui-switch-slider::after,
.ui-switch-input:checked + .ui-switch-slider::after,
.ui-switch:has(.ui-switch-input:checked) .ui-switch-slider::after {
  transform: translateX(22px);
}

.ui-switch-input.is-invalid + .ui-switch-slider,
.ui-switch:has(.ui-switch-input.is-invalid) .ui-switch-slider {
  background: #dc2626;
  box-shadow: inset 0 0 0 999px #dc2626;
}

.ui-switch-input.is-invalid + .ui-switch-slider::after {
  box-shadow: 0 1px 3px rgba(127, 29, 29, 0.24);
}

.ui-select-field {
  position: relative;
}

.ui-select-trigger {
  width: 100%;
  min-height: 40px;
  padding: 8px 40px 8px 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ui-select-trigger:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

.ui-select-trigger::after {
  content: '\25BE';
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.72rem;
  pointer-events: none;
}

.ui-select-field.is-open .ui-select-trigger,
.ui-select-trigger:focus,
.ui-select-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53, 101, 230, 0.12);
  outline: none;
}

.ui-select-field.is-invalid .ui-select-trigger {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.ui-switch-input.is-invalid + .ui-switch-slider {
  background: #dc2626;
  box-shadow: inset 0 0 0 999px #dc2626;
}

.ui-switch-input.is-invalid:checked + .ui-switch-slider::after {
  transform: translateX(22px);
}

.ui-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1090;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
  padding: 8px;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.ui-select-field.is-open .ui-select-trigger {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.ui-select-field.is-open .ui-select-menu {
  margin-top: 0;
}

.ui-select-field.is-open {
  z-index: 1091;
}

.ui-select-field.is-open .ui-select-menu {
  display: block;
}

.ui-select-field.is-open .ui-select-menu {
  display: block;
}

.ui-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ui-select-option .form-check-input {
  margin-top: 0;
  border-color: rgba(148, 163, 184, 0.9);
}

.ui-select-option:hover,
.ui-select-option-button:hover,
.ui-tree-select-option:hover,
.ui-select-option:focus-within {
  background: #f8fafc;
}

.ui-select-option-button,
.ui-tree-select-option {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.45;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ui-select-option-button:focus,
.ui-select-option-button:focus-visible,
.ui-tree-select-option:focus,
.ui-tree-select-option:focus-visible {
  outline: none;
  background: #f8fafc;
}

.ui-select-option-button.active,
.ui-tree-select-option.active {
  background: rgba(53, 101, 230, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.ui-tree-select-menu {
  padding: 8px;
}

.ui-tree-select-label {
  display: inline-block;
}

.ui-select-empty {
  padding: 16px 12px;
  color: var(--text-secondary);
  font-size: 0.83rem;
  text-align: center;
}

.ui-select-menu::-webkit-scrollbar {
  width: 8px;
}

.ui-select-menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.ui-select-menu::-webkit-scrollbar-track {
  background: transparent;
}

.modal-form-group .ui-select-field {
  width: 100%;
}

.modal-form-group .ui-select-trigger {
  width: 100%;
}

.modal-form-group .ui-select-field.is-invalid .ui-select-trigger {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.query-toolbar-control .ui-select-trigger {
  min-height: 38px;
}

.query-toolbar-control .ui-select-menu {
  min-width: 100%;
}

.dialog-detail .ui-select-trigger {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: default;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: static;
  transition: none;
  pointer-events: none;
  -webkit-text-fill-color: #0f172a;
}

.dialog-detail .ui-select-trigger::after,
.dialog-detail .ui-select-menu,
.dialog-detail .ui-select-field.is-open .ui-select-menu,
.dialog-detail .ui-select-field .ui-select-trigger[disabled]::after {
  display: none;
}

.dialog-detail .ui-select-field,
.dialog-detail .ui-select-field.is-open {
  min-width: 0;
  pointer-events: none;
  z-index: auto;
}

.dialog-detail .ui-select-trigger:hover,
.dialog-detail .ui-select-trigger:focus,
.dialog-detail .ui-select-trigger:focus-visible,
.dialog-detail .ui-select-field.is-open .ui-select-trigger,
.dialog-detail .ui-select-field.is-invalid .ui-select-trigger,
.dialog-detail .ui-select-field .ui-select-trigger[disabled],
.dialog-detail .ui-select-field .ui-select-trigger[disabled]:hover,
.dialog-detail .ui-select-field .ui-select-trigger[disabled]:focus,
.dialog-detail .ui-select-field .ui-select-trigger[disabled]:focus-visible {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.dialog-detail .ui-select-option,
.dialog-detail .ui-select-option-button,
.dialog-detail .ui-tree-select-option {
  padding: 0;
  background: transparent;
}

.dialog-detail .ui-select-option .form-check-input {
  display: none;
}

.dialog-detail .ui-tree-select-label {
  display: inline;
  font-weight: inherit;
}

.dialog-detail .ui-select-empty {
  padding: 0;
  text-align: left;
}

.authorize-toolbar {
  gap: 12px;
}

.authorize-count {
  color: var(--primary);
}

.authorize-header-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.authorize-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.authorize-header-icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.authorize-header-icon-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(53, 101, 230, 0.06);
}

.authorize-header-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.authorize-header-icon-btn i {
  font-size: 0.78rem;
}

.authorize-tree-panel {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.authorize-tree-table thead th {
  background: #f8fafc;
}

.authorize-tree-table tbody tr:hover {
  background: #fbfcfe;
}

.authorize-tree-table tbody tr td {
  border-bottom-color: #edf2f7;
}

.authorize-tree-table tbody tr:last-child td {
  border-bottom: none;
}

.authorize-check-cell {
  width: 52px;
  min-width: 52px;
  text-align: center;
  vertical-align: top;
  padding: 0 4px 0 12px !important;
  border-right: 1px solid rgba(237, 242, 247, 0.72);
  background: #fff;
}

.authorize-name-cell {
  width: auto;
  min-width: 0;
  vertical-align: top;
  padding: 0 12px 0 8px !important;
  background: #fff;
}

.authorize-tree-panel tbody tr:hover .authorize-check-cell,
.authorize-tree-panel tbody tr:hover .authorize-name-cell {
  background: #fbfcfe;
}

.authorize-tree-panel thead .authorize-check-cell {
  border-right: 1px solid rgba(226, 232, 240, 0.86);
}

.authorize-node-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  width: 100%;
  padding: 2px 8px 2px 0;
  user-select: none;
}

.authorize-node-branch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  align-self: stretch;
}

.authorize-node-branch::before {
  content: '';
  position: absolute;
  top: -12px;
  bottom: -12px;
  right: 8px;
  width: 1px;
  background: rgba(226, 232, 240, 0.82);
}

.authorize-node-branch-root {
  width: 0 !important;
}

.authorize-node-branch-root::before {
  display: none;
}

.authorize-node-toggle,
.authorize-node-toggle.tree-toggle-placeholder {
  margin-right: 0;
  flex-shrink: 0;
  align-self: center;
}

.authorize-tree-table .tree-toggle {
  width: 22px;
  height: 22px;
}

.authorize-tree-table .tree-toggle i {
  font-size: 0.72rem;
}

.authorize-tree-table .tree-toggle-placeholder {
  width: 22px;
  height: 22px;
  background: transparent;
}

.authorize-node-checkbox {
  margin: 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
}

.authorize-tree-panel .form-check-input:checked,
.authorize-tree-panel .authorize-node-checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.authorize-tree-panel .form-check-input:indeterminate,
.authorize-tree-panel .authorize-node-checkbox:indeterminate,
.authorize-node-checkbox-partial:indeterminate {
  background-color: var(--primary);
  border-color: var(--primary);
}

.authorize-tree-panel .form-check-input:focus,
.authorize-tree-panel .authorize-node-checkbox:focus,
.authorize-tree-panel .authorize-node-checkbox-partial:focus {
  box-shadow: 0 0 0 2px rgba(53, 101, 230, 0.12);
}

.authorize-node-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  min-width: 0;
  flex: 1;
  line-height: 1.45;
  font-size: 0.85rem;
  color: inherit;
  word-break: break-word;
  overflow-wrap: anywhere;
  user-select: text;
  transition: color 0.15s ease;
}

.authorize-node-depth-0 .authorize-node-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: #1f2937;
}

.authorize-node-depth-0 .authorize-node-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: rgba(53, 101, 230, 0.28);
  margin-right: 8px;
  flex-shrink: 0;
}

.authorize-node-depth-1 .authorize-node-label {
  font-weight: 500;
  color: #1f2937;
}

.authorize-node-depth-2 .authorize-node-label,
.authorize-node-depth-3 .authorize-node-label,
.authorize-node-depth-4 .authorize-node-label,
.authorize-node-depth-5 .authorize-node-label {
  font-size: 0.84rem;
  color: #475569;
}

.authorize-tree-panel tbody tr:hover .authorize-node-label {
  color: #0f172a;
}

.authorize-tree-panel tbody tr:hover .authorize-node-depth-2 .authorize-node-label,
.authorize-tree-panel tbody tr:hover .authorize-node-depth-3 .authorize-node-label,
.authorize-tree-panel tbody tr:hover .authorize-node-depth-4 .authorize-node-label,
.authorize-tree-panel tbody tr:hover .authorize-node-depth-5 .authorize-node-label {
  color: #334155;
}

.authorize-tree-panel .table.data-table tbody td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.authorize-tree-panel .table.data-table thead th {
  padding-top: 12px;
  padding-bottom: 12px;
}

.authorize-empty {
  color: var(--text-secondary);
}

.authorize-tree-panel .text-center.authorize-empty {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.authorize-tree-panel tbody tr.tree-highlight td {
  background: #f8fbff;
}

.authorize-node-cell .tree-toggle:hover {
  background: rgba(53, 101, 230, 0.08);
}

.authorize-row-depth-0 .authorize-node-cell {
  min-height: 40px;
  gap: 6px;
}

.authorize-row-depth-1 .authorize-node-cell,
.authorize-row-depth-2 .authorize-node-cell,
.authorize-row-depth-3 .authorize-node-cell,
.authorize-row-depth-4 .authorize-node-cell,
.authorize-row-depth-5 .authorize-node-cell {
  min-height: 36px;
}

.authorize-row-depth-0 .authorize-node-branch {
  width: 0 !important;
}

.authorize-check-cell .form-check-input {
  margin-top: 11px;
}

.authorize-node-label,
.authorize-node-toggle {
  box-sizing: border-box;
}

.authorize-tree-table .authorize-node-checkbox-partial {
  border-color: var(--primary);
}

.authorize-tree-table .authorize-node-checkbox-partial:indeterminate::before {
  color: #fff;
}

.authorize-tree-panel .authorize-node-toggle.tree-toggle-expanded i {
  transform: rotate(90deg);
}

.authorize-tree-panel .authorize-name-cell {
  white-space: nowrap;
}

.authorize-tree-panel .authorize-node-cell {
  white-space: nowrap;
}

.authorize-tree-panel .authorize-node-label {
  white-space: normal;
}

.authorize-tree-panel .authorize-node-branch::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 8px;
  width: 12px;
  height: 1px;
  background: rgba(226, 232, 240, 0.82);
}

.authorize-node-branch-root::after {
  display: none;
}

.authorize-tree-panel .authorize-node-checkbox,
.authorize-tree-panel .authorize-node-label,
.authorize-tree-panel .authorize-node-toggle {
  position: relative;
  z-index: 1;
}

.authorize-tree-panel .authorize-node-cell {
  position: relative;
}

.authorize-tree-panel .authorize-node-branch {
  pointer-events: none;
}

.authorize-tree-panel .authorize-node-checkbox {
  box-shadow: none;
}

.authorize-tree-panel .authorize-node-label {
  cursor: default;
}

.authorize-tree-panel .authorize-node-checkbox-partial {
  background-color: var(--primary);
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-toggle,
.authorize-tree-panel .authorize-node-depth-1 .authorize-node-toggle {
  color: var(--text-secondary);
}

.authorize-tree-panel .authorize-node-toggle {
  justify-content: center;
}

.authorize-tree-panel .authorize-check-cell,
.authorize-tree-panel .authorize-name-cell {
  background-clip: padding-box;
}

.authorize-tree-panel tbody tr:hover .authorize-check-cell {
  border-right-color: rgba(226, 232, 240, 0.95);
}

.authorize-tree-panel .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-branch::after {
  z-index: 0;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-1 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-2 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-3 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-4 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-5 .authorize-node-label {
  display: inline-flex;
}

.authorize-tree-panel .authorize-node-label::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::after {
  display: none;
}

.authorize-tree-panel .authorize-node-label {
  max-width: 100%;
}

.authorize-tree-panel .authorize-node-cell {
  overflow: visible;
}

.authorize-tree-panel .authorize-node-toggle,
.authorize-tree-panel .authorize-node-checkbox {
  flex-shrink: 0;
}

.authorize-tree-panel .authorize-node-cell .tree-toggle i {
  transition: transform 0.2s ease;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label {
  letter-spacing: 0.1px;
}

.authorize-tree-panel .authorize-node-branch {
  min-width: 0;
}

.authorize-tree-panel .authorize-node-branch-root {
  min-width: 0;
}

.authorize-tree-panel .authorize-node-cell {
  box-sizing: border-box;
}

.authorize-tree-panel .authorize-node-branch,
.authorize-tree-panel .authorize-node-label,
.authorize-tree-panel .authorize-node-toggle {
  box-sizing: border-box;
}

.authorize-tree-panel .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-branch::after {
  pointer-events: none;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  align-self: center;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label {
  align-items: center;
}

.authorize-tree-panel .authorize-name-cell {
  min-width: 0;
}

.authorize-tree-panel .authorize-row {
  background: transparent;
}

.authorize-tree-panel .authorize-row td {
  transition: background-color 0.15s ease;
}

.authorize-tree-panel .authorize-row-depth-0 td {
  background-image: linear-gradient(to right, rgba(53, 101, 230, 0.02), rgba(53, 101, 230, 0));
}

.authorize-tree-panel tbody tr.authorize-row-depth-0:hover td {
  background-image: linear-gradient(to right, rgba(53, 101, 230, 0.04), rgba(53, 101, 230, 0));
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-1 .authorize-node-label {
  color: #1f2937;
}

.authorize-tree-panel .authorize-node-depth-2 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-3 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-4 .authorize-node-label,
.authorize-tree-panel .authorize-node-depth-5 .authorize-node-label {
  color: #475569;
}

.authorize-tree-panel .authorize-node-checkbox {
  appearance: auto;
}

.authorize-tree-panel .authorize-check-cell .form-check-input {
  vertical-align: middle;
}

.authorize-tree-panel .authorize-node-toggle.tree-toggle-placeholder::after {
  content: none;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-depth-0 .authorize-node-branch::after {
  display: none;
}

.authorize-tree-panel .authorize-node-depth-1 .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-depth-2 .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-depth-3 .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-depth-4 .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-depth-5 .authorize-node-branch::before {
  display: block;
}

.authorize-tree-panel .authorize-node-depth-1 .authorize-node-branch::after,
.authorize-tree-panel .authorize-node-depth-2 .authorize-node-branch::after,
.authorize-tree-panel .authorize-node-depth-3 .authorize-node-branch::after,
.authorize-tree-panel .authorize-node-depth-4 .authorize-node-branch::after,
.authorize-tree-panel .authorize-node-depth-5 .authorize-node-branch::after {
  display: block;
}

.authorize-tree-panel .authorize-node-label {
  position: relative;
}

.authorize-tree-panel .authorize-node-label::before,
.authorize-tree-panel .authorize-node-label::after {
  position: relative;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  position: relative;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  top: 0;
}

.authorize-tree-panel .authorize-node-label {
  text-rendering: optimizeLegibility;
}

.authorize-tree-panel .authorize-node-toggle {
  color: #64748b;
}

.authorize-tree-panel .authorize-node-toggle:hover {
  color: var(--primary);
}

.authorize-tree-panel .authorize-node-checkbox-partial {
  outline: none;
}

.authorize-tree-panel .authorize-node-cell {
  gap: 8px;
}

.authorize-tree-panel .authorize-node-branch {
  margin-right: 0;
}

.authorize-tree-panel .authorize-node-toggle {
  margin-left: 0;
}

.authorize-tree-panel .authorize-node-label {
  margin-left: 0;
}

.authorize-tree-panel .authorize-node-checkbox {
  position: relative;
}

.authorize-tree-panel .authorize-node-cell {
  contain: layout paint;
}

.authorize-tree-panel .authorize-node-label {
  contain: layout;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  contain: paint;
}

.authorize-tree-panel .authorize-node-toggle,
.authorize-tree-panel .authorize-node-checkbox,
.authorize-tree-panel .authorize-node-label {
  transform: translateZ(0);
}

.authorize-tree-panel .authorize-node-branch {
  transform: translateZ(0);
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  transform: translateZ(0);
}

.authorize-tree-panel .authorize-row-depth-0 .authorize-node-cell,
.authorize-tree-panel .authorize-row-depth-1 .authorize-node-cell {
  min-height: 40px;
}

.authorize-tree-panel .authorize-row-depth-2 .authorize-node-cell,
.authorize-tree-panel .authorize-row-depth-3 .authorize-node-cell,
.authorize-tree-panel .authorize-row-depth-4 .authorize-node-cell,
.authorize-tree-panel .authorize-row-depth-5 .authorize-node-cell {
  min-height: 36px;
}

.authorize-tree-panel .authorize-check-cell {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.authorize-tree-panel .authorize-name-cell {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.authorize-tree-panel .authorize-node-cell {
  margin: 0;
}

.authorize-tree-panel .authorize-node-label {
  flex: 1;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  margin-right: 8px;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-cell {
  gap: 6px;
}

.authorize-tree-panel .authorize-node-depth-1 .authorize-node-cell,
.authorize-tree-panel .authorize-node-depth-2 .authorize-node-cell,
.authorize-tree-panel .authorize-node-depth-3 .authorize-node-cell,
.authorize-tree-panel .authorize-node-depth-4 .authorize-node-cell,
.authorize-tree-panel .authorize-node-depth-5 .authorize-node-cell {
  gap: 8px;
}

.authorize-tree-panel .authorize-node-checkbox-partial:checked {
  background-color: var(--primary);
}

.authorize-tree-panel .authorize-node-checkbox-partial:indeterminate {
  background-color: var(--primary);
}

.authorize-tree-panel .authorize-node-checkbox-partial {
  border-color: var(--primary);
}

.authorize-tree-panel .authorize-node-checkbox-partial:focus {
  box-shadow: 0 0 0 2px rgba(53, 101, 230, 0.12);
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label {
  text-transform: none;
}

.authorize-tree-panel .authorize-node-cell {
  position: relative;
}

.authorize-tree-panel .authorize-node-label {
  position: relative;
}

.authorize-tree-panel .authorize-node-checkbox {
  flex-shrink: 0;
}

.authorize-tree-panel .authorize-node-label {
  flex-shrink: 1;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  display: inline-block;
}

.authorize-tree-panel .authorize-row td {
  box-sizing: border-box;
}

.authorize-tree-panel .authorize-node-cell,
.authorize-tree-panel .authorize-node-label,
.authorize-tree-panel .authorize-node-branch,
.authorize-tree-panel .authorize-node-toggle {
  box-sizing: border-box;
}

.authorize-tree-panel .authorize-node-depth-0 .authorize-node-label::before {
  box-sizing: border-box;
}

.authorize-tree-panel .authorize-node-label {
  max-width: 100%;
}

.authorize-tree-panel .authorize-name-cell {
  width: calc(100% - 52px);
}

.authorize-tree-panel .authorize-node-checkbox {
  cursor: pointer;
}

.authorize-tree-panel .authorize-node-label {
  cursor: default;
}

.authorize-tree-panel .authorize-tree-table {
  table-layout: fixed;
}

.authorize-tree-panel .authorize-tree-table td,
.authorize-tree-panel .authorize-tree-table th {
  overflow: hidden;
}

.authorize-tree-panel .authorize-node-label {
  text-overflow: ellipsis;
}

.authorize-tree-panel .authorize-node-toggle,
.authorize-tree-panel .authorize-node-checkbox,
.authorize-tree-panel .authorize-node-branch {
  white-space: nowrap;
}

.authorize-tree-panel .authorize-node-toggle,
.authorize-tree-panel .authorize-node-branch,
.authorize-tree-panel .authorize-node-checkbox {
  user-select: none;
}

.authorize-tree-panel .authorize-node-cell .authorize-node-label {
  min-width: 0;
}

.authorize-tree-panel .authorize-node-cell .authorize-node-toggle {
  min-width: 22px;
}

.authorize-tree-panel .authorize-node-cell .authorize-node-branch {
  min-width: 0;
}

.authorize-tree-panel .authorize-node-cell .authorize-node-branch::before,
.authorize-tree-panel .authorize-node-cell .authorize-node-branch::after {
  pointer-events: none;
}

.authorize-tree-panel .authorize-node-label {
  display: inline-flex;
}

.authorize-tree-panel .authorize-row-depth-0 .authorize-node-label,
.authorize-tree-panel .authorize-row-depth-1 .authorize-node-label,
.authorize-tree-panel .authorize-row-depth-2 .authorize-node-label,
.authorize-tree-panel .authorize-row-depth-3 .authorize-node-label,
.authorize-tree-panel .authorize-row-depth-4 .authorize-node-label,
.authorize-tree-panel .authorize-row-depth-5 .authorize-node-label {
  align-items: center;
}

.authorize-tree-panel .authorize-node-cell .tree-toggle i {
  will-change: transform;
}

.authorize-tree-panel .authorize-node-cell .tree-toggle,
.authorize-tree-panel .authorize-node-cell .tree-toggle-placeholder {
  will-change: transform;
}

.authorize-tree-panel .authorize-node-branch {
  align-self: stretch;
}

.authorize-tree-panel .authorize-node-toggle.tree-toggle-placeholder {
  border-radius: 4px;
}

.authorize-tree-panel .authorize-node-label {
  position: relative;
  z-index: 1;
}

.authorize-tree-panel .authorize-check-cell .form-check-input {
  margin-top: 0;
}

/* ==================== Responsive ==================== */
@media (max-width: 767.98px) {
  .authorize-node-cell {
    gap: 4px;
  }

  .authorize-check-cell {
    width: 44px;
  }

  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar.collapsed {
    width: var(--sidebar-width);
  }
  .sidebar.collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 18px 20px;
  }
  .sidebar.collapsed .brand-text-sm { display: inline; }
  .sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: flex-start;
    padding: 10px 20px;
    gap: 12px;
  }
  .sidebar.collapsed .sidebar-nav .nav-link span { display: inline; }
  .sidebar.collapsed .sidebar-nav .nav-link i { width: 18px; font-size: 1rem; }
  .sidebar.collapsed .nav-divider { display: block; }
  .sidebar.collapsed .nav-directory-toggle .nav-directory-arrow { display: inline; }
  .sidebar.collapsed .nav-directory-children { display: flex !important; }
  .sidebar.collapsed .nav-directory-toggle.collapsed ~ .nav-directory-children { display: none !important; }
  .sidebar.collapsed ~ .main-content { margin-left: 0; }
  .main-content { margin-left: 0; }
  .login-wrapper { flex-direction: column; max-width: 420px; }
  .login-left { display: none; }
  .login-right { padding: 32px 24px; }
}
