.sidebar {
  position: relative;
  height: 100vh;
  background: #f8fafc;
  color: #0f172a;
}

@media (min-width: 768px) {
  .sidebar {
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
  }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(2, 6, 23, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .sidebar-backdrop {
    display: none;
  }
}

.sidebar-panel {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: 40;
  height: 100vh;
  width: 18rem;
  transform: translateX(-100%);
  border-right: 1px solid #e2e8f0;
  background: #fff;
  transition: transform 0.2s ease;
}

@media (min-width: 768px) {
  .sidebar-panel {
    position: static;
    transform: translateX(0);
  }
}

.sidebar-content {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.sidebar-header,
.sidebar-footer {
  min-height: 3.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 0.5rem 0 0.5rem;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
  padding: 0.5rem;
}

.sidebar-menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  padding: 0.75rem;
}

.menu-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-label {
  padding: 0 0.75rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-btn:hover {
  background: #f1f5f9;
  color: #020617;
}

.menu-btn-active {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.menu-btn-active:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.menu-btn-lg {
  padding: 0.625rem 0.5rem;
}

.menu-btn-sm {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  font-size: 0.875rem;
  color: #475569;
}

.menu-subgroup {
  margin-top: 0.25rem;
  margin-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 1px solid #e2e8f0;
  padding-left: 0.75rem;
}

.collapsible-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease;
}

.collapsible-panel > div {
  overflow: hidden;
}

.collapsible-panel.open {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.sidebar-page {
  height: 100vh;
  overflow-y: auto;
  background: #f8fafc;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-sm {
  height: 2.25rem;
  width: 2.25rem;
}

.btn-ghost {
  color: #475569;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #020617;
}

.btn-outline {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn-outline:hover {
  background: #f8fafc;
  color: #020617;
}

.btn-icon-sm {
  height: 2rem;
  width: 2rem;
}

.separator {
  background: #e2e8f0;
}

.separator-vertical {
  width: 1px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #475569;
}

.breadcrumb-link {
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: #020617;
}

.breadcrumb-page {
  font-weight: 500;
  color: #020617;
}

.breadcrumb-separator {
  color: #94a3b8;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 50;
  visibility: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: 0.25rem;
  opacity: 0;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dropdown.open .dropdown-menu {
  visibility: visible;
  opacity: 1;
}

.dropdown-label {
  border-radius: 0.75rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #334155;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #020617;
}

.dropdown-separator {
  height: 1px;
  margin: 0.25rem 0;
  background: #e2e8f0;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  height: 100vh;
  width: 100vw;
  max-height: none;
  max-width: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.dialog[open] {
  display: block;
}

.dialog::backdrop {
  background: transparent;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-panel {
  position: relative;
  top: 50%;
  left: 50%;
  width: min(32rem, calc(100vw - 2rem));
  transform: translate(-50%, -50%);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
}

.dialog-content {
  padding: 1.5rem;
}

.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-open .sidebar-panel {
  transform: translateX(0);
}
