:root {
  --base-sidebar-width: 260px;
  --base-sidebar-collapsed-width: 72px;
  --base-sidebar-gap: 20px;
  --base-sidebar-bg: rgba(15, 23, 42, 0.88);
  --base-sidebar-bg-gradient: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(30, 41, 59, 0.88) 100%
  );
  --base-sidebar-border-gradient: linear-gradient(
    180deg,
    rgba(168, 85, 159, 0.5) 0%,
    rgba(99, 102, 241, 0.4) 50%,
    rgba(148, 163, 184, 0.15) 100%
  );
  --base-sidebar-item-hover: rgba(148, 163, 184, 0.1);
  --base-sidebar-item-active: rgba(99, 102, 241, 0.18);
  --base-sidebar-border: rgba(148, 163, 184, 0.12);
  --base-sidebar-text: #e2e8f0;
  --base-sidebar-text-muted: #94a3b8;
  --base-sidebar-accent: #818cf8;
  --base-sidebar-group-header: #94a3b8;
  --base-sidebar-control-bg: rgba(15, 23, 42, 0.5);
  --base-sidebar-control-bg-hover: rgba(30, 41, 59, 0.72);
  --base-sidebar-control-border: rgba(148, 163, 184, 0.18);
  --base-sidebar-control-placeholder: #94a3b8;
}

body.theme-light {
  --base-sidebar-bg: rgba(255, 255, 255, 0.95);
  --base-sidebar-bg-gradient: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(241, 245, 249, 0.95) 100%
  );
  --base-sidebar-border-gradient: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.3) 0%,
    rgba(168, 85, 159, 0.2) 50%,
    rgba(148, 163, 184, 0.15) 100%
  );
  --base-sidebar-item-hover: rgba(99, 102, 241, 0.06);
  --base-sidebar-item-active: rgba(99, 102, 241, 0.12);
  --base-sidebar-border: rgba(148, 163, 184, 0.18);
  --base-sidebar-text: #1e293b;
  --base-sidebar-text-muted: #64748b;
  --base-sidebar-accent: #6366f1;
  --base-sidebar-group-header: #64748b;
  --base-sidebar-control-bg: rgba(99, 102, 241, 0.08);
  --base-sidebar-control-bg-hover: rgba(99, 102, 241, 0.14);
  --base-sidebar-control-border: rgba(99, 102, 241, 0.2);
  --base-sidebar-control-placeholder: #64748b;
}

.base-sidebar {
  width: var(--base-sidebar-width);
  background:
    var(--base-sidebar-bg-gradient) padding-box,
    var(--base-sidebar-border-gradient) border-box;
  border-right: 1px solid transparent;
  padding: 0;
  color: var(--base-sidebar-text);
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    4px 0 24px rgba(15, 23, 42, 0.35),
    inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.base-sidebar--floating-left {
  top: 0;
  height: 100vh;
  padding-top: var(--navbar-offset, 54px);
  box-shadow:
    4px 0 30px rgba(15, 23, 42, 0.45),
    inset -1px 0 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 0.25s ease,
    width 0.25s ease;
}

/* Header Section */
.base-sidebar__header {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--base-sidebar-border);
  flex-shrink: 0;
  overflow: visible;
  position: relative;
}

.base-sidebar__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--base-sidebar-text);
  margin: 0;
}

.base-sidebar__title i {
  color: var(--base-sidebar-accent);
  font-size: 18px;
}

.base-sidebar__title-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.base-sidebar__title-card {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.65))
      padding-box,
    linear-gradient(135deg, rgba(168, 85, 159, 0.5), rgba(99, 102, 241, 0.45))
      border-box;
  border: 1px solid transparent;
  margin-bottom: 10px;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__title-card:hover {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.75))
      padding-box,
    linear-gradient(135deg, rgba(168, 85, 159, 0.65), rgba(99, 102, 241, 0.6))
      border-box;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.base-sidebar__title-card:active {
  transform: translateY(0);
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.base-sidebar__title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.base-sidebar__title-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.base-sidebar__title-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--base-sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.base-sidebar__title-subtext {
  font-size: 12px;
  font-weight: 500;
  color: var(--base-sidebar-text-muted);
}

/* ── Welcome Panel (user dashboard sidebar header) ───────────── */
.base-sidebar__welcome-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.65))
      padding-box,
    linear-gradient(135deg, rgba(168, 85, 159, 0.5), rgba(99, 102, 241, 0.45))
      border-box;
  border: 1px solid transparent;
  margin-bottom: 10px;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.base-sidebar__welcome-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  background: linear-gradient(135deg, #a8559f 0%, #7b88c7 100%);
  box-shadow: 0 6px 14px rgba(123, 136, 199, 0.35);
  text-transform: uppercase;
  flex-shrink: 0;
}

.base-sidebar__welcome-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.base-sidebar__welcome-greeting {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0;
}

.base-sidebar__welcome-email {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-light .base-sidebar__welcome-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.85))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 159, 0.2))
      border-box;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.theme-light .base-sidebar__welcome-greeting {
  color: #64748b;
}

body.theme-light .base-sidebar__welcome-email {
  color: #1e293b;
}

/* ── Logout Button (sidebar footer) ──────────────────────────── */
.base-sidebar__logout-form {
  margin: 0;
}

.base-sidebar__logout-btn {
  width: 100%;
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(148, 163, 184, 0.15) !important;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #e2e8f0 !important;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
  font-family: inherit;
}

.base-sidebar__logout-btn i {
  font-size: 0.95rem;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(239, 68, 68, 0.2));
}

.base-sidebar__logout-btn:hover {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  transform: translateY(-1px);
  color: #e2e8f0 !important;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.3),
    0 0 0 1px rgba(248, 113, 113, 0.15);
}

.base-sidebar__logout-btn:active {
  transform: translateY(0);
}

body.theme-light .base-sidebar__logout-btn {
  color: #1e293b !important;
  background: rgba(248, 250, 252, 0.9) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

body.theme-light .base-sidebar__logout-btn i {
  background: rgba(248, 113, 113, 0.12);
  color: #dc2626 !important;
}

body.theme-light .base-sidebar__logout-btn:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(248, 113, 113, 0.1);
}

/* Search Box — styled to match dashboard-tab-btn */
.base-sidebar__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__search:hover {
  background: var(--base-sidebar-item-hover);
  border-color: rgba(148, 163, 184, 0.2) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.3);
}

.base-sidebar__search:hover .base-sidebar__search-icon-wrap {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
}

.base-sidebar__search:hover .base-sidebar__search-icon-wrap i {
  color: #ffffff;
}

.base-sidebar__search:hover .base-sidebar__search-label {
  color: #ffffff;
}

.base-sidebar__search--clickable,
.base-sidebar__search--clickable .base-sidebar__search-input {
  cursor: pointer;
}

.base-sidebar__search--clickable .search-field__input {
  cursor: pointer;
}

/* Icon container — matches dashboard-tab-btn .icon-container */
.base-sidebar__search-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__search-icon-wrap i {
  font-size: 14px;
  color: #cbd5e1;
  transition: all 0.3s ease;
}

/* Search label — matches dashboard-tab-btn span */
.base-sidebar__search-label {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  transition: color 0.2s ease;
  line-height: 1.2;
  min-width: 0;
}

/* Kbd badge — compact, right-aligned */
.base-sidebar__search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--base-sidebar-text-muted);
  font-size: 11px;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.base-sidebar__search:hover .base-sidebar__search-kbd {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--base-sidebar-accent);
}

/* Search field variant (admin uses .search-field inside .base-sidebar__search) */
.base-sidebar__search .search-field {
  flex: 1;
  max-width: none;
  min-width: 0;
}

.base-sidebar__search .search-field__input {
  height: 36px !important;
  line-height: 36px !important;
  padding: 0 44px 0 36px !important;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(148, 163, 184, 0.15) !important;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__search .search-field__input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.base-sidebar__search .search-field__icon {
  top: 50%;
  left: 12px;
  font-size: 13px;
  color: #94a3b8;
}

.base-sidebar__search:hover .search-field__input {
  background: rgba(148, 163, 184, 0.12) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
}

.base-sidebar__search .search-field__input:focus {
  background: rgba(99, 102, 241, 0.12) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  color: #ffffff !important;
}

/* Legacy search-input (user sidebar uses flat input) */
.base-sidebar__search-input {
  width: 100%;
  padding: 8px 50px 8px 36px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 11px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.base-sidebar__search-input:focus {
  outline: none;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  color: #ffffff;
}

.base-sidebar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

/* Sidebar controls (inputs, dropdowns, action buttons) */
.base-sidebar__controls {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--base-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.base-sidebar__controls--placeholder {
  border-top: 0;
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.5))
      padding-box,
    linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(99, 102, 241, 0.18))
      border-box;
  border: 1px solid transparent;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  gap: 8px;
}

/* ── Quick Jump (input + Go button) ───────────────────────── */
.base-sidebar__quick-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 6px;
}

.base-sidebar__quick-jump-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.base-sidebar__quick-jump-input {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  font-size: 13px;
  line-height: normal;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.base-sidebar__quick-jump-input::placeholder {
  color: #64748b;
  opacity: 1;
}

.base-sidebar__quick-jump-input:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.55);
}

.base-sidebar__quick-jump-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.base-sidebar__quick-jump-btn {
  flex-shrink: 0;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 159, 0.35);
  background: rgba(99, 102, 241, 0.9);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.base-sidebar__quick-jump-btn:hover {
  background: rgba(99, 102, 241, 1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.base-sidebar__quick-jump-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Light theme -- quick jump */
body.theme-light .base-sidebar__quick-jump-input {
  background: rgba(241, 245, 249, 0.75);
  border-color: rgba(148, 163, 184, 0.25);
  color: #1e293b;
}

body.theme-light .base-sidebar__quick-jump-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

body.theme-light .base-sidebar__quick-jump-input:hover {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(99, 102, 241, 0.25);
}

body.theme-light .base-sidebar__quick-jump-input:focus {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

body.theme-light .base-sidebar__quick-jump-btn {
  background: rgba(99, 102, 241, 0.9);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

body.theme-light .base-sidebar__quick-jump-btn:hover {
  background: rgba(99, 102, 241, 1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

/* ── Vertical Line for Dropdowns ─────────────────────────────── */
.base-sidebar__item--with-line {
  position: relative;
}

.base-sidebar__item--with-line.expanded > .base-sidebar__submenu::before {
  content: '';
  position: absolute;
  top: 0px;
  bottom: 0;
  left: 21px;
  width: 1px;
  background: rgba(148, 163, 184, 0.2);
  z-index: 1;
}

body.theme-light
  .base-sidebar__item--with-line.expanded
  > .base-sidebar__submenu::before {
  background: rgba(148, 163, 184, 0.35);
}

.base-sidebar__control-caption {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.base-sidebar__control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.base-sidebar__control-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.base-sidebar__control-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--base-sidebar-text-muted);
  line-height: 1.2;
}

.base-sidebar__control-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.45);
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.base-sidebar__control-shell:hover {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.base-sidebar__control-shell:focus-within {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.12),
    0 10px 20px rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
}

.base-sidebar__control-leading-icon,
.base-sidebar__control-trailing-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--base-sidebar-text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.base-sidebar__control-leading-icon {
  left: 9px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2),
    rgba(168, 85, 159, 0.18)
  );
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.12);
  font-size: 10px;
}

.base-sidebar__control-trailing-icon {
  right: 11px;
}

.base-sidebar__control-input,
.base-sidebar__control-select,
.base-sidebar__control-textarea {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--base-sidebar-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 12px 8px 40px;
  transition: color 0.2s ease;
  box-sizing: border-box;
}

.base-sidebar__control-input::placeholder,
.base-sidebar__control-textarea::placeholder {
  color: var(--base-sidebar-control-placeholder);
}

.base-sidebar__control-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  cursor: pointer;
}

.base-sidebar__control-shell--select {
  cursor: pointer;
}

.base-sidebar__control-shell--select .base-sidebar__control-trailing-icon {
  right: 10px;
  font-size: 10px;
  color: #94a3b8;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.base-sidebar__control-shell--select:hover
  .base-sidebar__control-trailing-icon {
  color: var(--base-sidebar-accent);
}

.base-sidebar__control-textarea {
  min-height: 78px;
  resize: vertical;
  padding-top: 10px;
  padding-bottom: 10px;
}

.base-sidebar__control-input:hover,
.base-sidebar__control-select:hover,
.base-sidebar__control-textarea:hover {
  background: transparent;
  border-color: transparent;
}

.base-sidebar__control-shell:focus-within .base-sidebar__control-leading-icon,
.base-sidebar__control-shell:focus-within .base-sidebar__control-trailing-icon {
  color: var(--base-sidebar-accent);
}

.base-sidebar__control-input:focus,
.base-sidebar__control-select:focus,
.base-sidebar__control-textarea:focus {
  outline: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Force quick-tools form controls to ignore global input/select defaults. */
.base-sidebar__control-shell > .base-sidebar__control-input,
.base-sidebar__control-shell > .base-sidebar__control-select,
.base-sidebar__control-shell > .base-sidebar__control-textarea {
  margin: 0 !important;
  width: 100% !important;
  min-height: 38px !important;
  padding: 8px 12px 8px 40px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--base-sidebar-text) !important;
}

.base-sidebar__control-shell > .base-sidebar__control-input::placeholder,
.base-sidebar__control-shell > .base-sidebar__control-textarea::placeholder {
  color: var(--base-sidebar-control-placeholder) !important;
}

.base-sidebar__control-shell > .base-sidebar__control-select {
  padding-right: 32px !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.base-sidebar__control-shell > .base-sidebar__control-input:focus,
.base-sidebar__control-shell > .base-sidebar__control-select:focus,
.base-sidebar__control-shell > .base-sidebar__control-textarea:focus {
  outline: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Sidebar quick-tools with dropdown component */
.base-sidebar__control-shell .custom-dropdown {
  width: 100%;
  display: block;
}

.base-sidebar__control-shell .custom-dropdown-trigger {
  margin: 0 !important;
  width: 100% !important;
  min-height: 38px !important;
  padding: 8px 32px 8px 40px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--base-sidebar-text) !important;
  font-size: 13px;
  font-weight: 600;
}

.base-sidebar__control-shell .custom-dropdown-trigger:hover,
.base-sidebar__control-shell .custom-dropdown-trigger:focus:not(:disabled),
.base-sidebar__control-shell .custom-dropdown.open .custom-dropdown-trigger {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.base-sidebar__control-shell--select:has(.custom-dropdown)
  .base-sidebar__control-trailing-icon {
  display: none;
}

.base-sidebar__control-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.base-sidebar__control-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid var(--base-sidebar-control-border);
  background: var(--base-sidebar-control-bg);
  padding: 8px 10px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.base-sidebar__control-switch:hover {
  background: var(--base-sidebar-control-bg-hover);
  border-color: rgba(148, 163, 184, 0.3);
}

.base-sidebar__control-switch-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.base-sidebar__control-switch-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.35);
  position: relative;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.base-sidebar__control-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease;
}

.base-sidebar__control-switch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--base-sidebar-text);
  line-height: 1.2;
}

.base-sidebar__control-switch-input:checked
  + .base-sidebar__control-switch-track {
  background: rgba(99, 102, 241, 0.48);
  border-color: rgba(99, 102, 241, 0.5);
}

.base-sidebar__control-switch-input:checked
  + .base-sidebar__control-switch-track
  .base-sidebar__control-switch-thumb {
  transform: translateX(14px);
}

.base-sidebar__button {
  flex: 1;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: var(--base-sidebar-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.base-sidebar__button:hover {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.3);
}

.base-sidebar__button:active {
  transform: translateY(0);
}

.base-sidebar__button--primary {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.78) 0%,
    rgba(168, 85, 159, 0.78) 100%
  );
  border-color: rgba(168, 85, 159, 0.42);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.28);
}

.base-sidebar__button--primary:hover {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.9) 0%,
    rgba(168, 85, 159, 0.9) 100%
  );
  border-color: rgba(168, 85, 159, 0.54);
  box-shadow: 0 14px 24px rgba(99, 102, 241, 0.35);
}

/* Content Area */
.base-sidebar__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.base-sidebar__content::-webkit-scrollbar {
  width: 6px;
}

.base-sidebar__content::-webkit-scrollbar-track {
  background: transparent;
}

.base-sidebar__content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 3px;
}

body.theme-light .base-sidebar__content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
}

/* Menu Structure */
.base-sidebar__menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.base-sidebar__group {
  margin-bottom: 4px;
}

.base-sidebar__group-header {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--base-sidebar-group-header);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.base-sidebar__group-header i,
.base-sidebar__group-header .base-sidebar__group-header-icon {
  font-size: 10px;
}

.base-sidebar__group-header .base-sidebar__group-header-icon {
  display: inline-flex;
  align-items: center;
}

/* Menu Items */
.base-sidebar__item {
  margin: 3px 6px;
  list-style: none;
}

.base-sidebar__item-link,
.base-sidebar__item-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin: 0;
  color: var(--base-sidebar-text);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent !important;
  border-radius: 12px;
  background: transparent !important;
  width: 100%;
  text-align: left;
  font-size: 14px !important;
  font-family: inherit !important;
  font-style: normal !important;
  line-height: inherit;
  font-weight: 500 !important;
  position: relative;
  box-sizing: border-box;
  outline: none;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}

.base-sidebar__item-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--base-sidebar-text-muted);
  transition: color 0.2s ease;
}

.base-sidebar__item-icon--unicode {
  font-style: normal;
  line-height: 1;
}

.base-sidebar__item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.base-sidebar__item-action--has-context {
  padding-right: 34px;
}

.base-sidebar__context-trigger {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  color: var(--base-sidebar-text-muted);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.base-sidebar__context-trigger::after {
  content: '';
  width: 10px;
  height: 10px;
  margin: 4px auto;
  display: block;
  background-color: currentColor;
  -webkit-mask-image: var(--fa-solid-ellipsis);
  mask-image: var(--fa-solid-ellipsis);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-link:hover
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-link:focus-visible
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-toggle:hover
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-toggle:focus-visible
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-link:focus-within
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__item-toggle:focus-within
  .base-sidebar__context-trigger,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__context-trigger:hover,
.base-sidebar[data-sidebar-context-menu-enabled='1']
  .base-sidebar__context-trigger:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.base-sidebar__context-trigger:hover,
.base-sidebar__context-trigger:focus-visible {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.48);
  color: var(--base-sidebar-text);
  transform: translateY(-50%) scale(1.03);
  outline: none;
}

.base-sidebar__item-badge {
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
  flex-shrink: 0;
}

.base-sidebar__item-badge--info {
  background: rgba(74, 158, 255, 0.15);
  color: #4a9eff;
  border-color: rgba(74, 158, 255, 0.3);
}

.base-sidebar__item-badge--success {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border-color: rgba(40, 167, 69, 0.3);
}

.base-sidebar__item-badge--warning {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border-color: rgba(255, 193, 7, 0.3);
}

.base-sidebar__item-chevron {
  width: 16px;
  text-align: center;
  font-size: 12px;
  flex-shrink: 0;
  color: var(--base-sidebar-text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__item-link:hover,
.base-sidebar__item-toggle:hover {
  background: var(--base-sidebar-item-hover) !important;
  border-color: rgba(148, 163, 184, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2) !important;
}

.base-sidebar__item-link:hover .base-sidebar__item-icon,
.base-sidebar__item-toggle:hover .base-sidebar__item-icon {
  color: var(--base-sidebar-accent);
}

.base-sidebar__item--dragging > .base-sidebar__item-link,
.base-sidebar__item--dragging > .base-sidebar__item-toggle {
  opacity: 0.55;
}

.base-sidebar__item--drop-on > .base-sidebar__item-link,
.base-sidebar__item--drop-on > .base-sidebar__item-toggle {
  background: rgba(46, 204, 113, 0.15) !important;
}

.base-sidebar__item--drop-before > .base-sidebar__item-link,
.base-sidebar__item--drop-before > .base-sidebar__item-toggle {
  box-shadow: inset 0 2px 0 var(--base-sidebar-accent) !important;
}

.base-sidebar__item--drop-after > .base-sidebar__item-link,
.base-sidebar__item--drop-after > .base-sidebar__item-toggle {
  box-shadow: inset 0 -2px 0 var(--base-sidebar-accent) !important;
}

/* Dropdown submenu items */
.base-sidebar__item.expanded > .base-sidebar__submenu {
  margin-top: 6px;
  margin-bottom: 6px;
}

.base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item {
  margin: 2px 12px 2px 28px;
}

.base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-link,
.base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-toggle {
  padding: 7px 12px 7px 14px;
  font-size: 13px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--base-sidebar-text-muted);
}

.base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-link:hover,
.base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-toggle:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.15);
  color: #ffffff;
}

body.theme-light
  .base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-link,
body.theme-light
  .base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-toggle {
  background: transparent;
  border-color: transparent;
  color: #64748b;
}

body.theme-light
  .base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-link:hover,
body.theme-light
  .base-sidebar__item[data-item-id='placeholder-more']
  .base-sidebar__submenu
  .base-sidebar__item-toggle:hover {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
  color: #1e293b;
}

body.theme-light .base-sidebar__context-trigger {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.45);
  color: #64748b;
}

body.theme-light .base-sidebar__context-trigger:hover,
body.theme-light .base-sidebar__context-trigger:focus-visible {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.38);
  color: #1e293b;
}

.base-sidebar__item-link.active,
.base-sidebar__item-toggle.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(168, 85, 159, 0.18) 100%
  ) !important;
  border-color: rgba(123, 136, 199, 0.3) !important;
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.base-sidebar__item-link.active .base-sidebar__item-icon,
.base-sidebar__item-toggle.active .base-sidebar__item-icon {
  color: var(--base-sidebar-accent);
}

.base-sidebar__item-link.active::before,
.base-sidebar__item-toggle.active::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 159, 0.55),
    rgba(99, 102, 241, 0.55)
  );
  z-index: -1;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 1.5px;
}

/* Submenu/Children */
.base-sidebar__submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__item.expanded > .base-sidebar__submenu {
  max-height: 800px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
    margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.base-sidebar__item.expanded
  > .base-sidebar__item-toggle
  .base-sidebar__item-chevron {
  transform: rotate(90deg);
}

.base-sidebar__submenu .base-sidebar__item-link,
.base-sidebar__submenu .base-sidebar__item-toggle {
  padding-left: 20px;
  font-size: 13px;
}

/* Extension menu items (analytics, etc.) - subtle orange tint */
.base-sidebar__item--extension > .base-sidebar__item-toggle,
.base-sidebar__item--extension > .base-sidebar__item-link {
  background: rgba(255, 152, 0, 0.08);
}

.base-sidebar__item--extension > .base-sidebar__item-toggle:hover,
.base-sidebar__item--extension > .base-sidebar__item-link:hover {
  background: rgba(255, 152, 0, 0.14);
}

.base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-toggle,
.base-sidebar__item--extension .base-sidebar__submenu .base-sidebar__item-link {
  background: rgba(255, 152, 0, 0.06);
}

.base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-toggle:hover,
.base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-link:hover {
  background: rgba(255, 152, 0, 0.12);
}

body.theme-light .base-sidebar__item--extension > .base-sidebar__item-toggle,
body.theme-light .base-sidebar__item--extension > .base-sidebar__item-link {
  background: rgba(255, 152, 0, 0.1);
}

body.theme-light
  .base-sidebar__item--extension
  > .base-sidebar__item-toggle:hover,
body.theme-light
  .base-sidebar__item--extension
  > .base-sidebar__item-link:hover {
  background: rgba(255, 152, 0, 0.18);
}

body.theme-light
  .base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-toggle,
body.theme-light
  .base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-link {
  background: rgba(255, 152, 0, 0.08);
}

body.theme-light
  .base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-toggle:hover,
.base-sidebar__item--extension
  .base-sidebar__submenu
  .base-sidebar__item-link:hover {
  background: rgba(255, 152, 0, 0.15);
}

/* Separator */
.base-sidebar__separator {
  height: 1px;
  background: var(--base-sidebar-border);
  margin: 8px 12px;
}

/* ── Light theme: sidebar-specific overrides ────────────────────── */
body.theme-light .base-sidebar {
  box-shadow:
    4px 0 24px rgba(15, 23, 42, 0.08),
    inset -1px 0 0 rgba(0, 0, 0, 0.04);
}

body.theme-light .base-sidebar--floating-left {
  box-shadow:
    4px 0 30px rgba(15, 23, 42, 0.1),
    inset -1px 0 0 rgba(0, 0, 0, 0.04);
}

body.theme-light .base-sidebar__title-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.85))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 159, 0.2))
      border-box;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.theme-light .base-sidebar__title-card:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 159, 0.35))
      border-box;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.theme-light .base-sidebar__search:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.18) !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

body.theme-light .base-sidebar__search-icon-wrap {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.18);
}

body.theme-light .base-sidebar__search-icon-wrap i {
  color: #475569;
}

body.theme-light .base-sidebar__search:hover .base-sidebar__search-icon-wrap {
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body.theme-light .base-sidebar__search:hover .base-sidebar__search-icon-wrap i {
  color: #1e293b;
}

body.theme-light .base-sidebar__search-label {
  color: #475569;
}

body.theme-light .base-sidebar__search:hover .base-sidebar__search-label {
  color: #1e293b;
}

body.theme-light .base-sidebar__search-kbd {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
  color: #64748b;
}

body.theme-light .base-sidebar__search:hover .base-sidebar__search-kbd {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--base-sidebar-accent);
}

body.theme-light .base-sidebar__search .search-field__input {
  background: rgba(99, 102, 241, 0.06) !important;
  border-color: rgba(99, 102, 241, 0.15) !important;
  color: #475569 !important;
}

body.theme-light .base-sidebar__search .search-field__input::placeholder {
  color: #94a3b8;
}

body.theme-light .base-sidebar__search:hover .search-field__input {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

body.theme-light .base-sidebar__search .search-field__input:focus {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  color: #1e293b !important;
}

body.theme-light .base-sidebar__search-input {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.15);
  color: #475569;
}

body.theme-light .base-sidebar__search-input:focus {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  color: #1e293b;
}

body.theme-light .base-sidebar__control-label {
  color: #64748b;
}

body.theme-light .base-sidebar__control-leading-icon,
body.theme-light .base-sidebar__control-trailing-icon {
  color: #64748b;
}

body.theme-light .base-sidebar__control-shell {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-light .base-sidebar__control-shell:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow:
    0 10px 18px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-light .base-sidebar__control-shell:focus-within {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 8px 16px rgba(15, 23, 42, 0.12);
}

body.theme-light .base-sidebar__control-leading-icon {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.22);
  color: #475569;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

body.theme-light .base-sidebar__control-input,
body.theme-light .base-sidebar__control-select,
body.theme-light .base-sidebar__control-textarea {
  color: #1e293b;
}

body.theme-light .base-sidebar__control-input:focus,
body.theme-light .base-sidebar__control-select:focus,
body.theme-light .base-sidebar__control-textarea:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.theme-light .base-sidebar__button {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
  color: #1e293b;
}

body.theme-light .base-sidebar__button:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

body.theme-light .base-sidebar__button--primary {
  color: #ffffff;
}

body.theme-light .base-sidebar__controls--placeholder {
  background:
    linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.92),
        rgba(241, 245, 249, 0.88)
      )
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 159, 0.15))
      border-box;
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.theme-light .base-sidebar__control-caption {
  color: #1e293b;
}

body.theme-light .base-sidebar__control-switch {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.18);
}

body.theme-light .base-sidebar__control-switch:hover {
  background: rgba(99, 102, 241, 0.1);
}

body.theme-light .base-sidebar__control-switch-track {
  background: rgba(148, 163, 184, 0.28);
  border-color: rgba(148, 163, 184, 0.38);
}

body.theme-light .base-sidebar__control-switch-label {
  color: #1e293b;
}

body.theme-light .base-sidebar__item-link:hover,
body.theme-light .base-sidebar__item-toggle:hover {
  background: rgba(99, 102, 241, 0.06) !important;
  border-color: rgba(99, 102, 241, 0.15) !important;
  color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .base-sidebar__item-link:hover .base-sidebar__item-icon,
body.theme-light .base-sidebar__item-toggle:hover .base-sidebar__item-icon {
  color: #6366f1;
}

body.theme-light .base-sidebar__item-link.active,
body.theme-light .base-sidebar__item-toggle.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.14) 0%,
    rgba(168, 85, 159, 0.14) 100%
  ) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  color: #1e293b;
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

body.theme-light .base-sidebar__item-link.active .base-sidebar__item-icon,
body.theme-light .base-sidebar__item-toggle.active .base-sidebar__item-icon {
  color: #6366f1;
}

/* Text Only Item */
.base-sidebar__text-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--base-sidebar-text-muted);
  font-style: italic;
}

/* Drag & Drop Styles */
.base-sidebar--dragging .base-sidebar__item {
  cursor: move;
}

.base-sidebar__item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.base-sidebar__item.drag-over {
  border-top: 2px solid var(--base-sidebar-accent);
}

/* Drag placeholder - shows where item will drop */
.base-sidebar__drag-placeholder {
  position: relative;
  background: transparent;
  border: 2px dashed var(--base-sidebar-accent);
  border-radius: 4px;
  margin: 4px 0;
  min-height: 40px;
  opacity: 0.6;
  pointer-events: none;
  transition: all 0.2s ease;
}

.base-sidebar__drag-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--base-sidebar-accent);
  opacity: 0.1;
  border-radius: 2px;
}

.base-sidebar__drag-handle {
  width: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--base-sidebar-text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.base-sidebar__drag-handle:active {
  cursor: grabbing;
}

.base-sidebar--dragging .base-sidebar__drag-handle {
  opacity: 1;
}

.base-sidebar__item:hover .base-sidebar__drag-handle {
  opacity: 0.5;
}

.base-sidebar__item:hover:active .base-sidebar__drag-handle {
  opacity: 1;
}

.base-sidebar__item:hover .base-sidebar__drag-handle {
  opacity: 0.5;
}

.base-sidebar__item:hover .base-sidebar__drag-handle:hover {
  opacity: 1;
  color: var(--base-sidebar-accent);
}

/* Footer */
.base-sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--base-sidebar-border);
  flex-shrink: 0;
}

/* ── Collapse Toggle Button (top utility control) ────────── */
.base-sidebar__collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 0 10px auto;
  border: 1px solid var(--base-sidebar-control-border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(30, 41, 59, 0.58))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 159, 0.28))
      border-box;
  color: var(--base-sidebar-text);
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.base-sidebar__collapse-toggle i {
  font-size: 13px;
  transition:
    transform 0.2s ease,
    color 0.15s ease;
  flex-shrink: 0;
}

.base-sidebar__collapse-toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 10px 0;
}

.base-sidebar__collapse-toggle-label {
  display: none;
}

.base-sidebar__collapse-toggle:hover {
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.76), rgba(51, 65, 85, 0.68))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(168, 85, 159, 0.45))
      border-box;
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--base-sidebar-accent);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.3),
    0 0 0 1px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.base-sidebar__collapse-toggle:hover i {
  transform: scale(1.1);
}

.base-sidebar__collapse-toggle:active i {
  transform: scale(0.92);
}

.base-sidebar__collapse-toggle:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-light .base-sidebar__collapse-toggle {
  background:
    linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.96),
        rgba(241, 245, 249, 0.92)
      )
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.26), rgba(168, 85, 159, 0.2))
      border-box;
  color: #475569;
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-light .base-sidebar__collapse-toggle:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(238, 242, 255, 0.96))
      padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.36), rgba(168, 85, 159, 0.28))
      border-box;
  color: var(--base-sidebar-accent);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(99, 102, 241, 0.08);
}

/* Mobile Controls */
.base-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.92), rgba(168, 85, 159, 0.88))
      padding-box,
    linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18),
        rgba(255, 255, 255, 0.06)
      )
      border-box;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 600;
  cursor: pointer;
  height: 40px;
  position: relative;
  z-index: 1250;
  font-size: 14px;
  box-shadow:
    0 10px 24px rgba(99, 102, 241, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.base-sidebar-toggle:hover {
  box-shadow:
    0 12px 26px rgba(99, 102, 241, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.base-sidebar-toggle i {
  font-size: 16px;
}

.base-sidebar-toggle:active {
  transform: translateY(0);
}

body.theme-light .base-sidebar-toggle {
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.base-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(99, 102, 241, 0.18),
      transparent 46%
    ),
    rgba(2, 6, 23, 0.56);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
}

.base-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: all;
}

body.theme-light .base-sidebar-backdrop {
  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(99, 102, 241, 0.12),
      transparent 46%
    ),
    rgba(15, 23, 42, 0.36);
}

.base-sidebar__mobile-close {
  display: none;
}

.base-sidebar-toggle-slot {
  display: none;
}

/* Responsive Design */
@media (max-width: 900px) {
  .base-sidebar {
    width: min(360px, calc(100vw - 14px));
    max-width: calc(100vw - 14px);
    height: 100dvh;
    max-height: 100dvh;
    top: 0;
    left: 0;
    transform: translate3d(calc(-100% - 20px), 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-right: 1px solid transparent;
    border-radius: 0 20px 20px 0;
    box-shadow:
      12px 0 38px rgba(2, 6, 23, 0.42),
      inset -1px 0 0 rgba(255, 255, 255, 0.05);
    z-index: 1350 !important;
    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease,
      visibility 0s linear 0.28s;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .base-sidebar.is-open {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease;
  }

  .base-sidebar--floating-left {
    padding-top: 0;
  }

  .base-sidebar__header {
    padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.28),
        rgba(15, 23, 42, 0.08)
      )
      padding-box;
  }

  body.theme-light .base-sidebar__header {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.62),
        rgba(255, 255, 255, 0.18)
      )
      padding-box;
  }

  .base-sidebar__mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    height: 40px;
    margin: 0 0 10px auto;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--base-sidebar-control-border);
    background:
      linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.52))
        padding-box,
      linear-gradient(
          135deg,
          rgba(148, 163, 184, 0.18),
          rgba(99, 102, 241, 0.18)
        )
        border-box;
    color: var(--base-sidebar-text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    box-shadow:
      0 8px 16px rgba(15, 23, 42, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      transform 0.2s ease,
      box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
  }

  .base-sidebar__mobile-close i {
    font-size: 12px;
    opacity: 0.9;
  }

  .base-sidebar__mobile-close:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--base-sidebar-accent);
    box-shadow:
      0 10px 18px rgba(15, 23, 42, 0.24),
      0 0 0 1px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
  }

  .base-sidebar__mobile-close:active {
    transform: translateY(0);
  }

  body.theme-light .base-sidebar__mobile-close {
    background:
      linear-gradient(
          135deg,
          rgba(255, 255, 255, 0.95),
          rgba(241, 245, 249, 0.9)
        )
        padding-box,
      linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 159, 0.16))
        border-box;
    color: #475569;
    box-shadow:
      0 8px 16px rgba(15, 23, 42, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .base-sidebar__mobile-close:hover {
    color: var(--base-sidebar-accent);
  }

  .base-sidebar__collapse-toggle {
    display: none !important;
  }

  .base-sidebar__collapse-toggle-row {
    display: none !important;
  }

  .base-sidebar__collapse-toggle-label {
    display: none !important;
  }

  .base-sidebar__content {
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .base-sidebar__footer {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(
      180deg,
      rgba(15, 23, 42, 0) 0%,
      rgba(15, 23, 42, 0.22) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  body.theme-light .base-sidebar__footer {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(241, 245, 249, 0.55) 100%
    );
  }

  .base-sidebar__item {
    margin: 4px 8px;
  }

  .base-sidebar__item-link,
  .base-sidebar__item-toggle {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 15px !important;
  }

  .base-sidebar__item-icon {
    width: 20px;
    font-size: 17px;
  }

  .base-sidebar__search,
  .base-sidebar__title-card,
  .base-sidebar__welcome-panel,
  .base-sidebar__controls--placeholder {
    border-radius: 16px;
  }

  .base-sidebar-toggle-slot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: 0 0 12px 0;
    padding: 0;
  }

  .base-sidebar-toggle {
    display: inline-flex;
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: auto;
    top: auto;
    z-index: 1405;
    height: 48px;
    width: 48px;
    min-width: 48px;
    padding: 0;
    gap: 0;
    border-radius: 16px;
    border-color: rgba(99, 102, 241, 0.3);
    background:
      linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92))
        padding-box,
      linear-gradient(135deg, rgba(99, 102, 241, 0.65), rgba(168, 85, 159, 0.5))
        border-box;
    box-shadow:
      0 16px 34px rgba(15, 23, 42, 0.34),
      0 0 0 1px rgba(99, 102, 241, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
  }

  .base-sidebar-toggle.base-sidebar-toggle--inline {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    top: auto;
    z-index: 20;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    box-shadow:
      0 12px 24px rgba(15, 23, 42, 0.22),
      0 0 0 1px rgba(99, 102, 241, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .navbar .navbar-wrapper .base-sidebar-toggle.base-sidebar-toggle--inline {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 6px 0 6px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.24) !important;
    background:
      linear-gradient(
        135deg,
        rgba(184, 84, 80, 0.34) 0%,
        rgba(168, 85, 159, 0.28) 30%,
        rgba(139, 111, 168, 0.24) 50%,
        rgba(123, 136, 199, 0.26) 70%,
        rgba(99, 102, 241, 0.32) 85%,
        rgba(129, 140, 248, 0.28) 100%
      ),
      rgba(0, 0, 0, 0.18) !important;
    color: #ffffff !important;
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1001;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline) {
    align-items: center !important;
    --base-sidebar-nav-center-nudge: 0px;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .navbar-logo {
    position: absolute;
    left: 50%;
    top: calc(50% + var(--base-sidebar-nav-center-nudge));
    transform: translate(-50%, -50%);
    height: 44px;
    min-height: 44px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    line-height: 1;
    z-index: 1000;
    max-width: calc(100% - 190px);
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .navbar-logo::before {
    display: block;
    margin: 0;
    transform: none;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .base-sidebar-toggle.base-sidebar-toggle--inline {
    position: relative;
    top: auto;
    bottom: auto;
    align-self: center;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1;
    transform: translateY(var(--base-sidebar-nav-center-nudge)) !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle {
    height: 44px;
    min-height: 44px;
    top: calc(50% + var(--base-sidebar-nav-center-nudge)) !important;
    transform: translateY(-50%) !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(1) {
    top: 14px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(2) {
    top: 21px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(3) {
    top: 28px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle[aria-expanded='true']
    span:nth-child(1) {
    top: 21px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle[aria-expanded='true']
    span:nth-child(3) {
    top: 21px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .theme-toggle-navbar {
    height: 48px;
    min-height: 48px;
    top: calc(50% + var(--base-sidebar-nav-center-nudge)) !important;
    transform: translateY(-50%) !important;
  }

  .base-sidebar-toggle:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow:
      0 18px 36px rgba(15, 23, 42, 0.38),
      0 0 0 1px rgba(99, 102, 241, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
  }

  .base-sidebar-toggle.base-sidebar-toggle--inline:hover {
    transform: translateY(-1px);
  }

  .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline:hover {
    transform: translateY(var(--base-sidebar-nav-center-nudge)) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    background:
      linear-gradient(
        135deg,
        rgba(184, 84, 80, 0.42) 0%,
        rgba(168, 85, 159, 0.34) 30%,
        rgba(139, 111, 168, 0.3) 50%,
        rgba(123, 136, 199, 0.32) 70%,
        rgba(99, 102, 241, 0.38) 85%,
        rgba(129, 140, 248, 0.34) 100%
      ),
      rgba(0, 0, 0, 0.2) !important;
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  body:has(.base-sidebar.is-open),
  body.base-sidebar-mobile-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Lower navbar z-index on mobile so sidebar can be clicked */
  body:has(.base-sidebar.is-open) .navbar,
  body.base-sidebar-mobile-open .navbar {
    z-index: 1100;
  }

  body:has(.base-sidebar.is-open) .base-sidebar-toggle,
  body.base-sidebar-mobile-open .base-sidebar-toggle {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
  }

  .base-sidebar__control-row {
    grid-template-columns: 1fr;
  }

  body:has(.base-sidebar--floating-left) main.landing-container {
    margin-left: 0;
    width: 100%;
  }

  /* Force expanded layout on mobile even if desktop collapse state is saved. */
  .base-sidebar--collapsed {
    width: min(360px, calc(100vw - 14px));
    max-width: calc(100vw - 14px);
    overflow-x: hidden;
  }

  .base-sidebar--collapsed .base-sidebar__header {
    padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
  }

  .base-sidebar--collapsed .base-sidebar__item-text,
  .base-sidebar--collapsed .base-sidebar__item-chevron,
  .base-sidebar--collapsed .base-sidebar__submenu,
  .base-sidebar--collapsed .base-sidebar__separator,
  .base-sidebar--collapsed .base-sidebar__logout-btn span {
    display: revert !important;
  }

  .base-sidebar--collapsed .base-sidebar__group-header {
    display: flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__search {
    display: flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__controls {
    display: flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__quick-jump {
    display: flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__title-text,
  .base-sidebar--collapsed .base-sidebar__welcome-text {
    display: flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__item-badge {
    display: inline-flex !important;
  }

  .base-sidebar--collapsed .base-sidebar__title-card,
  .base-sidebar--collapsed .base-sidebar__welcome-panel {
    width: 100%;
    height: auto;
    margin: 0 0 10px 0;
    padding: 10px 12px;
    justify-content: flex-start;
    border-radius: 16px;
  }

  .base-sidebar--collapsed .base-sidebar__welcome-panel {
    padding: 11px 12px;
  }

  .base-sidebar--collapsed .base-sidebar__content {
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
  }

  .base-sidebar--collapsed .base-sidebar__item {
    margin: 4px 8px;
  }

  .base-sidebar--collapsed .base-sidebar__item-link,
  .base-sidebar--collapsed .base-sidebar__item-toggle {
    width: 100%;
    height: auto;
    min-height: 48px;
    margin: 0;
    padding: 10px 12px;
    justify-content: flex-start;
    border-radius: 14px;
    gap: 12px;
  }

  .base-sidebar--collapsed .base-sidebar__item-icon {
    margin: 0;
    width: 20px;
    font-size: 17px;
  }

  .base-sidebar--collapsed .base-sidebar__footer {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .base-sidebar--collapsed .base-sidebar__logout-btn {
    width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    justify-content: flex-start;
    border-radius: 14px;
    gap: 10px;
  }

  .base-sidebar--collapsed .base-sidebar__logout-form {
    display: block;
  }

  .base-sidebar--collapsed .base-sidebar__item-link[data-tooltip]::after,
  .base-sidebar--collapsed .base-sidebar__item-toggle[data-tooltip]::after {
    content: none;
  }

  .base-sidebar-toggle i {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .base-sidebar-toggle span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fafc;
    line-height: 1;
  }

  body.theme-light .base-sidebar-toggle {
    border-color: rgba(99, 102, 241, 0.24);
    background:
      linear-gradient(
          135deg,
          rgba(255, 255, 255, 0.97),
          rgba(241, 245, 249, 0.94)
        )
        padding-box,
      linear-gradient(
          135deg,
          rgba(99, 102, 241, 0.36),
          rgba(168, 85, 159, 0.26)
        )
        border-box;
    box-shadow:
      0 14px 28px rgba(15, 23, 42, 0.12),
      0 0 0 1px rgba(99, 102, 241, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body.theme-light .base-sidebar-toggle:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow:
      0 16px 30px rgba(15, 23, 42, 0.14),
      0 0 0 1px rgba(99, 102, 241, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }

  body.theme-light .base-sidebar-toggle.base-sidebar-toggle--inline {
    box-shadow:
      0 10px 20px rgba(15, 23, 42, 0.1),
      0 0 0 1px rgba(99, 102, 241, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body.theme-light .base-sidebar-toggle i {
    color: #334155;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
  }

  body.theme-light .base-sidebar-toggle span {
    color: #0f172a;
  }

  .navbar .navbar-wrapper .base-sidebar-toggle.base-sidebar-toggle--inline i {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #e2e8f0 !important;
  }

  .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline
    span {
    display: none !important;
  }

  body.theme-light
    .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline {
    border-color: rgba(255, 255, 255, 0.32) !important;
    background:
      linear-gradient(
        135deg,
        rgba(184, 84, 80, 0.34) 0%,
        rgba(168, 85, 159, 0.26) 30%,
        rgba(139, 111, 168, 0.24) 50%,
        rgba(123, 136, 199, 0.28) 70%,
        rgba(99, 102, 241, 0.34) 85%,
        rgba(129, 140, 248, 0.3) 100%
      ),
      rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    box-shadow:
      0 2px 8px rgba(15, 23, 42, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  body.theme-light
    .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline:hover {
    border-color: rgba(255, 255, 255, 0.42) !important;
    background:
      linear-gradient(
        135deg,
        rgba(184, 84, 80, 0.42) 0%,
        rgba(168, 85, 159, 0.32) 30%,
        rgba(139, 111, 168, 0.28) 50%,
        rgba(123, 136, 199, 0.34) 70%,
        rgba(99, 102, 241, 0.4) 85%,
        rgba(129, 140, 248, 0.36) 100%
      ),
      rgba(255, 255, 255, 0.22) !important;
    box-shadow:
      0 4px 12px rgba(15, 23, 42, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  body.theme-light
    .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline
    i {
    background: rgba(255, 255, 255, 0.26) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    color: #ffffff !important;
  }

  body.theme-light
    .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline
    span {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .base-sidebar {
    width: calc(100vw - 8px);
    max-width: calc(100vw - 8px);
    border-radius: 0 18px 18px 0;
  }

  .base-sidebar--collapsed {
    width: calc(100vw - 8px);
    max-width: calc(100vw - 8px);
  }

  .base-sidebar-toggle {
    height: 38px;
    width: 38px;
    min-width: 38px;
    padding: 0;
    border-radius: 13px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .base-sidebar-toggle.base-sidebar-toggle--inline {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    right: auto;
    bottom: auto;
  }

  .navbar .navbar-wrapper .base-sidebar-toggle.base-sidebar-toggle--inline {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    margin: 0 4px 0 4px;
    border-radius: 11px;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .navbar-logo {
    height: 40px;
    min-height: 40px;
    max-width: calc(100% - 170px);
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle {
    height: 40px;
    min-height: 40px;
    width: 40px;
    min-width: 40px;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(1) {
    top: 12px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(2) {
    top: 19px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle
    span:nth-child(3) {
    top: 26px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle[aria-expanded='true']
    span:nth-child(1) {
    top: 19px !important;
  }

  .navbar
    .navbar-wrapper:has(.base-sidebar-toggle.base-sidebar-toggle--inline)
    .nav-toggle[aria-expanded='true']
    span:nth-child(3) {
    top: 19px !important;
  }

  .base-sidebar-toggle i {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 12px;
  }

  .base-sidebar-toggle span {
    display: none !important;
  }

  .navbar
    .navbar-wrapper
    .base-sidebar-toggle.base-sidebar-toggle--inline
    span {
    display: none !important;
  }

  .base-sidebar-toggle-slot {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .base-sidebar,
  .base-sidebar-toggle,
  .base-sidebar__mobile-close,
  .base-sidebar-backdrop {
    transition: none !important;
  }
}

@media (min-width: 901px) {
  .base-sidebar__collapse-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px 0;
    padding: 0 0 0 2px;
  }

  .base-sidebar__collapse-toggle-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
  }

  .base-sidebar__collapse-toggle {
    width: 40px;
    min-width: 40px;
    padding: 0;
    gap: 0;
    justify-content: center;
    margin: 0;
  }

  .base-sidebar--collapsed .base-sidebar__collapse-toggle {
    width: 44px;
    min-width: 44px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }

  .base-sidebar--collapsed .base-sidebar__collapse-toggle-row {
    justify-content: center;
    padding-left: 0;
  }

  .base-sidebar--collapsed .base-sidebar__collapse-toggle-label {
    display: none !important;
  }

  body:has(.base-sidebar--floating-left) main.container {
    padding-left: calc(
      var(--base-sidebar-width) + var(--base-sidebar-gap) + 16px
    );
    padding-right: 24px;
    padding-top: calc(var(--navbar-offset, 54px) + 20px);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  body:has(.base-sidebar--floating-left) main.landing-container {
    padding-left: calc(
      var(--base-sidebar-width) + clamp(24px, 3vw, 48px)
    ) !important;
    padding-right: clamp(24px, 3vw, 48px) !important;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  body:has(.base-sidebar--floating-left)
    main.landing-container
    .dashboard-page {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  body:has(.base-sidebar--floating-left) .footer {
    padding-left: var(--base-sidebar-width);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  body:has(.base-sidebar--floating-left) .footer-nav-container,
  body:has(.base-sidebar--floating-left) .footer-bottom-container {
    padding-left: 0;
    padding-right: 0;
  }

  body:has(.base-sidebar--floating-left) .navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1300;
  }

  body:has(.base-sidebar--floating-left.base-sidebar--collapsed)
    main.container {
    padding-left: calc(
      var(--base-sidebar-collapsed-width) + var(--base-sidebar-gap) + 16px
    );
  }

  body:has(.base-sidebar--floating-left.base-sidebar--collapsed)
    main.landing-container {
    padding-left: calc(
      var(--base-sidebar-collapsed-width) + clamp(24px, 3vw, 48px)
    ) !important;
  }

  body:has(.base-sidebar--floating-left.base-sidebar--collapsed) .footer {
    padding-left: var(--base-sidebar-collapsed-width);
  }
}

/* Hidden state for filtered items */
.base-sidebar__item.hidden {
  display: none;
}

.base-sidebar__group.hidden {
  display: none;
}

.base-sidebar__search-input {
  padding-left: 36px !important;
}

/* ============================================================================
   COLLAPSED STATE — icon-only sidebar (add .base-sidebar--collapsed)
   ============================================================================ */

.base-sidebar--collapsed {
  --base-sidebar-width: var(--base-sidebar-collapsed-width);
  width: var(--base-sidebar-collapsed-width);
  overflow-x: hidden;
}

.base-sidebar--collapsed .base-sidebar__header {
  padding: 14px 0 10px;
}

.base-sidebar--collapsed .base-sidebar__collapse-toggle {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px auto;
  border-radius: 14px;
}

.base-sidebar--collapsed .base-sidebar__item-text,
.base-sidebar--collapsed .base-sidebar__item-chevron,
.base-sidebar--collapsed .base-sidebar__item-badge,
.base-sidebar--collapsed .base-sidebar__title-text,
.base-sidebar--collapsed .base-sidebar__search,
.base-sidebar--collapsed .base-sidebar__controls,
.base-sidebar--collapsed .base-sidebar__submenu,
.base-sidebar--collapsed .base-sidebar__group-header,
.base-sidebar--collapsed .base-sidebar__separator,
.base-sidebar--collapsed .base-sidebar__welcome-text,
.base-sidebar--collapsed .base-sidebar__quick-jump,
.base-sidebar--collapsed .base-sidebar__logout-btn span {
  display: none !important;
}

.base-sidebar--collapsed .base-sidebar__title-card {
  padding: 10px;
  padding-right: 10px;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px auto;
  border-radius: 14px;
  box-sizing: border-box;
}

.base-sidebar--collapsed .base-sidebar__title-icon {
  margin: 0;
}

.base-sidebar--collapsed .base-sidebar__welcome-panel {
  width: 44px;
  height: 44px;
  padding: 0;
  padding-right: 0;
  margin: 0 auto 10px auto;
  justify-content: center;
  border-radius: 14px;
  box-sizing: border-box;
}

.base-sidebar--collapsed .base-sidebar__content {
  padding: 8px 0;
  overflow-x: hidden;
}

.base-sidebar--collapsed .base-sidebar__menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
}

.base-sidebar--collapsed .base-sidebar__item {
  margin: 3px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.base-sidebar--collapsed .base-sidebar__item-link,
.base-sidebar--collapsed .base-sidebar__item-toggle {
  padding: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  gap: 0;
  position: relative;
}

.base-sidebar--collapsed .base-sidebar__item-action--has-context {
  padding-right: 0;
}

.base-sidebar--collapsed .base-sidebar__item-icon {
  margin: 0;
  width: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.base-sidebar--collapsed .base-sidebar__item-link > .base-sidebar__item-icon,
.base-sidebar--collapsed .base-sidebar__item-toggle > .base-sidebar__item-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}

.base-sidebar--collapsed .base-sidebar__item-link > .base-sidebar__item-icon::before,
.base-sidebar--collapsed
  .base-sidebar__item-toggle
  > .base-sidebar__item-icon::before {
  display: block;
  line-height: 1;
  margin: 0;
}

.base-sidebar--collapsed .base-sidebar__footer {
  padding: 10px 0;
}

.base-sidebar--collapsed .base-sidebar__logout-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 auto;
  justify-content: center;
  border-radius: 12px;
  gap: 0;
}

.base-sidebar--collapsed .base-sidebar__logout-btn i {
  width: 28px;
  height: 28px;
}

.base-sidebar--collapsed .base-sidebar__logout-form {
  display: flex;
  justify-content: center;
}

/* Tooltip for collapsed controls on hover */
.base-sidebar--collapsed .base-sidebar__item-link,
.base-sidebar--collapsed .base-sidebar__item-toggle {
  position: relative;
}

.base-sidebar--collapsed .base-sidebar__item-link[data-tooltip]::after,
.base-sidebar--collapsed .base-sidebar__item-toggle[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  background: var(--base-sidebar-bg, rgba(15, 23, 42, 0.95));
  color: var(--base-sidebar-text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  border: 1px solid var(--base-sidebar-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.base-sidebar--collapsed .base-sidebar__item-link[data-tooltip]:hover::after,
.base-sidebar--collapsed .base-sidebar__item-toggle[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* ============================================================================
   COMMAND PALETTE (Ctrl+K Quick Search)
   ============================================================================ */

.command-palette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px;
  animation: fadeIn 0.15s ease;
}

.command-palette-overlay.active {
  display: flex;
}

.command-palette {
  width: 100%;
  max-width: 640px;
  background: var(--base-sidebar-bg);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.command-palette__header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--base-sidebar-border);
}

.command-palette__header .search-field {
  width: 100%;
  max-width: none;
}

.command-palette__header .search-field__input {
  padding-right: 56px !important;
}

.command-palette__kbd {
  pointer-events: none;
}

.command-palette__results {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

.command-palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-left: 3px solid transparent;
}

.command-palette__item:hover {
  background: var(--base-sidebar-item-hover);
}

.command-palette__item.selected {
  background: var(--base-sidebar-item-hover);
  border-left-color: var(--base-sidebar-accent);
}

.command-palette__item-icon {
  width: 18px;
  text-align: center;
  color: var(--base-sidebar-text-muted);
  flex-shrink: 0;
  font-size: 16px;
}

.command-palette__item.selected .command-palette__item-icon {
  color: var(--base-sidebar-accent);
}

.command-palette__item-content {
  flex: 1;
  min-width: 0;
}

.command-palette__item-text {
  color: var(--base-sidebar-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette__item.selected .command-palette__item-text {
  color: var(--base-sidebar-accent);
  font-weight: 600;
}

.command-palette__item-breadcrumb {
  color: var(--base-sidebar-text-muted);
  font-size: 13px;
  font-weight: 400;
  margin-right: 4px;
}

.command-palette__empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--base-sidebar-text-muted);
}

.command-palette__empty i {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.command-palette__empty p {
  margin: 0;
  font-size: 14px;
}

.command-palette__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--base-sidebar-border);
  background: var(--base-sidebar-item-hover);
}

.command-palette__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--base-sidebar-text-muted);
}

.command-palette__hint kbd {
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--base-sidebar-bg);
  border: 1px solid var(--base-sidebar-border);
  color: var(--base-sidebar-text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Scrollbar styling for results */
.command-palette__results::-webkit-scrollbar {
  width: 8px;
}

.command-palette__results::-webkit-scrollbar-track {
  background: transparent;
}

.command-palette__results::-webkit-scrollbar-thumb {
  background: var(--base-sidebar-border);
  border-radius: 4px;
}

.command-palette__results::-webkit-scrollbar-thumb:hover {
  background: var(--base-sidebar-text-muted);
}

/* Mobile responsiveness */
@media (max-width: 900px) {
  .command-palette-overlay {
    padding: 60px 16px;
  }

  .command-palette {
    max-width: 100%;
  }

  .command-palette__results {
    max-height: 300px;
  }
}

/* ============================================================================
   FINAL MOBILE SIDEBAR OVERRIDE (must stay last to beat collapsed-state rules)
   ============================================================================ */
@media (max-width: 900px) {
  .base-sidebar.base-sidebar--collapsed {
    --base-sidebar-width: min(360px, calc(100vw - 14px)) !important;
    width: min(360px, calc(100vw - 14px)) !important;
    max-width: calc(100vw - 14px) !important;
    overflow-x: hidden !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__header {
    padding: calc(12px + env(safe-area-inset-top)) 12px 10px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-text,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__submenu,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__group-header,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__separator,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__search,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__controls,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__quick-jump,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__title-text,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__welcome-text,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__logout-btn span {
    display: revert !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-chevron {
    display: inline-flex !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-badge {
    display: inline-flex !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__title-card,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__welcome-panel {
    width: 100% !important;
    height: auto !important;
    margin: 0 0 10px 0 !important;
    padding: 10px 12px !important;
    justify-content: flex-start !important;
    border-radius: 16px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__welcome-panel {
    padding: 11px 12px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__content {
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item {
    margin: 4px 8px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-link,
  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-toggle {
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    justify-content: flex-start !important;
    border-radius: 14px !important;
    gap: 12px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__item-icon {
    width: 20px !important;
    font-size: 17px !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__footer {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__logout-form {
    display: block !important;
  }

  .base-sidebar.base-sidebar--collapsed .base-sidebar__logout-btn {
    width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    justify-content: flex-start !important;
    border-radius: 14px !important;
    gap: 10px !important;
  }

  .base-sidebar.base-sidebar--collapsed
    .base-sidebar__item-link[data-tooltip]::after,
  .base-sidebar.base-sidebar--collapsed
    .base-sidebar__item-toggle[data-tooltip]::after {
    content: none !important;
  }
}

@media (max-width: 520px) {
  .base-sidebar.base-sidebar--collapsed {
    --base-sidebar-width: calc(100vw - 8px) !important;
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
  }
}
