/* User Profile Sidebar Bottom */
.side-bottom {
  margin-top: auto;
  position: relative;
  border-top: 1px solid var(--ui-border-soft, rgba(205, 220, 216, 0.82));
  padding-top: 14px;
  color: var(--ui-text-3, #858D8A);
  font-size: 12px;
}

.user-profile-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--ui-border-soft, rgba(213, 226, 221, 0.72));
  border-radius: var(--ui-radius-lg, 16px);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ui-text, #151A19);
  box-shadow: var(--ui-shadow-xs, 0 6px 18px rgba(20, 35, 31, 0.04));
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.user-profile-btn:hover {
  border-color: rgba(27, 61, 130, 0.2);
  background: var(--ui-brand-soft, #EEF0EA);
  color: var(--ui-brand-2, #2864DC);
}

.user-profile-btn .avatar {
  width: 36px;
  height: 36px;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--ui-border-soft, rgba(213, 226, 221, 0.72));
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  margin: 0;
  flex-shrink: 0;
  box-shadow: none;
}

.notification-badge {
  position: absolute;
  top: 6px;
  left: 42px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  padding: 0 5px;
  background: #e5484d;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(229, 72, 77, 0.26);
}

.notification-badge[hidden] {
  display: none;
}

.sub-user {
  position: relative;
}

.sub-notification-badge {
  top: 8px;
  left: 44px;
}

.avatar img,
.user-profile-btn .avatar img,
.sub-user .avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.user-profile-btn .info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-profile-btn .name {
  color: var(--ui-text, #151A19);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-btn .plan,
.user-profile-btn .balance {
  font-size: 12px;
  color: var(--ui-text-3, #858D8A);
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Settings Menu Popup */
.settings-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  right: 0;
  width: 240px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--ui-border, rgba(31, 50, 57, 0.16));
  border-radius: var(--ui-radius-lg, 14px);
  box-shadow: var(--ui-shadow-md, 0 18px 44px rgba(20, 35, 31, 0.12));
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 100;
  overflow: hidden;
  font-family: var(--ui-font, var(--font-sans));
}

.settings-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-settings-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 12px);
  width: 100%;
  margin: 0;
  box-shadow: var(--shadow);
  transform: translateY(8px);
}

.settings-header {
  padding: 0 2px 10px;
  font-size: 12px;
  color: var(--ui-text-2, #59615F);
  border-bottom: 1px solid var(--ui-border-soft, #edf2f0);
  margin-bottom: 8px;
  font-weight: 520;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-menu .in-settings-menu {
  border-bottom: 1px solid var(--ui-border-soft, #edf2f0);
  padding: 8px 0 10px;
}

.workspace-switcher {
  position: relative;
}

.workspace-switcher-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 5px 8px;
  background: transparent;
  color: var(--ui-text, #151A19);
  text-align: left;
  box-shadow: none;
}

.workspace-switcher-current:hover,
.workspace-switcher-current[aria-expanded="true"] {
  background: var(--ui-brand-soft, #EEF0EA);
}

.workspace-switcher-current span,
.workspace-menu button span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-switcher-current strong,
.workspace-menu strong {
  overflow: hidden;
  color: var(--ui-text, #151A19);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher-current small,
.workspace-menu small {
  color: var(--ui-text-3, #858D8A);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.workspace-switcher-current svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #526760;
}

.workspace-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  margin-top: 6px;
  border: 0;
  border-radius: 6px;
  padding: 3px;
  background: transparent;
  box-shadow: none;
}

.in-settings-menu .workspace-menu {
  position: static;
}

.workspace-menu.active {
  display: grid;
  gap: 2px;
}

.workspace-menu button,
.workspace-manage-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: var(--ui-text-2, #59615F);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.35;
  text-align: left;
  box-shadow: none;
}

.workspace-menu button.active,
.workspace-menu button:hover,
.workspace-manage-link:hover {
  background: var(--ui-brand-soft, #EEF0EA);
  color: var(--ui-text, #151A19);
}

.workspace-menu button.active strong {
  color: var(--ui-brand-2, #2864DC);
}

.workspace-manage-link {
  margin-top: 4px;
  border-top: 1px solid var(--ui-border-soft, #edf2f0);
  padding-top: 9px;
  text-decoration: none;
}

.notification-panel {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #edf2f0;
  margin-bottom: 8px;
  padding: 2px 0 10px;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 0;
}

.notification-panel-head strong {
  display: block;
  color: #151A19;
  font-size: 12px;
  font-weight: 750;
}

.notification-panel-head span {
  color: #858D8A;
  font-size: 12px;
}

.notification-panel-head button {
  border: 1px solid rgba(27, 61, 130, 0.16);
  border-radius: 4px;
  padding: 5px 9px;
  background: #f2faf7;
  color: #2864DC;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.notification-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.notification-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  background: #f8fbfa;
  color: #151A19;
  text-align: left;
  cursor: pointer;
}

.notification-item.unread {
  border-color: rgba(27, 61, 130, 0.18);
  background: #eefaf6;
}

.notification-item span {
  color: #2864DC;
  font-size: 12px;
  font-weight: 800;
}

.notification-item strong {
  color: #151A19;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.notification-item small,
.notification-panel-empty {
  color: #858D8A;
  font-size: 12px;
  line-height: 1.45;
}

.notification-panel-empty {
  padding: 10px;
  border-radius: 6px;
  background: #f8fbfa;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: var(--ui-text-2, #59615F);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.35;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.settings-item:hover {
  background: var(--ui-brand-soft, #EEF0EA);
  color: var(--ui-text, #151A19);
}

.settings-item svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #526760;
}

/* Settings Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #fff;
  width: min(430px, calc(100% - 32px));
  border: 1px solid #dce7e2;
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 650;
  color: #111;
  margin: 0;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0f5f3;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d5e2dd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #2864DC;
}

.avatar-setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-setting-row input {
  flex: 1;
}

.avatar-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  overflow: hidden;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-cancel {
  padding: 10px 16px;
  border: 1px solid #d5e2dd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-save {
  padding: 10px 20px;
  background: #2864DC;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
