/* Shell styles: Collapsible Left Sidebar + Clean Top Navbar */

* { box-sizing: border-box; }

body.has-sidebar {
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg, #090d16);
  color: var(--text, #ffffff);
  overflow-x: hidden;
}

/* ==========================================================================
   Left Collapsible Sidebar (Default Collapsed: 68px, Expanded: 250px)
   ========================================================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 68px;
  background: rgba(12, 17, 31, 0.96);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 10px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: nowrap;
}

.sidebar.expanded {
  width: 250px;
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.22);
}

.sidebar-top {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  transition: all 0.16s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

.sidebar-brand-text {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  background: none;
  border: 1px solid transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
  position: relative;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.35));
  border: 1px solid rgba(129, 140, 248, 0.5);
  color: #ffffff;
  font-weight: 750;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.sidebar-btn.logout-btn {
  color: #fca5a5;
}

.sidebar-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.4);
}

.s-icon {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
}

.s-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.s-label {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.expanded .s-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Sidebar Backdrop on expansion */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

/* ==========================================================================
   Content Area & Minimal Top Header
   ========================================================================== */

.app-content-wrapper {
  margin-left: 68px;
  width: calc(100% - 68px);
  min-height: 100vh;
  min-width: 0;
}

.app-content-wrapper main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(9, 13, 22, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hl, .hr {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hl h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 0 4px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pt-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  display: grid;
  place-items: center;
  flex: none;
}

.pt-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#meChip {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 15px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#meChip::before {
  content: "";
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: var(--green, #10b981);
  box-shadow: 0 0 8px var(--green, #10b981);
}

@media (max-width: 768px) {
  .app-content-wrapper {
    margin-left: 0;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.expanded {
    transform: translateX(0);
    width: 240px;
  }
  header {
    padding: 12px 16px;
  }
  .hl h1 {
    font-size: 16px;
    padding-left: 10px;
  }
}
