/* =============================================================================
   admin-sidebar.css v3 — icon-only rail + popout (always minimised)
   ============================================================================= */

.admin-app-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.admin-app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar {
  --sb-width: 3.35rem;
  position: relative;
  flex: 0 0 var(--sb-width);
  width: var(--sb-width);
  max-width: var(--sb-width);
  min-height: 0;
  align-self: stretch;
  background: var(--bg-elevated, #0f172a);
  border-right: 1px solid var(--border, #1e293b);
  z-index: 30;
}

.admin-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0.5rem 0.3rem 0.5rem;
  gap: 0.35rem;
}

/* Toggle removed — rail stays icon-only */
.admin-sidebar-toggle {
  display: none !important;
}

.admin-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.15rem 0;
}

/* Section: icon only */
.admin-sidebar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding: 0.55rem 0.2rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  box-sizing: border-box;
  min-height: 2.75rem;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.admin-sidebar-section:hover:not(.is-disabled) {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.15);
}

.admin-sidebar-section.is-active {
  color: #f8fafc;
  background: linear-gradient(160deg, rgba(15, 48, 84, 0.95), rgba(29, 78, 216, 0.45));
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 14px rgba(15, 48, 84, 0.35);
}

.admin-sidebar-section.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-sidebar-section-label {
  display: none;
}

.admin-sidebar-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: inherit;
}

.admin-sidebar-section-icon svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

/* Popout panel */
.admin-sidebar-popout {
  position: absolute;
  left: 100%;
  top: 0.35rem;
  bottom: auto;
  width: 13.5rem;
  background: rgba(8, 15, 30, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0 0.6rem 0.6rem 0;
  box-shadow: 8px 8px 28px rgba(0, 0, 0, 0.4);
  padding: 0.55rem 0.45rem 0.55rem;
  z-index: 40;
}

.admin-sidebar-popout[hidden] {
  display: none !important;
}

.admin-sidebar-popout-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7dd3fc;
  padding: 0.15rem 0.45rem 0.4rem;
}

.admin-sidebar-popout-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-sidebar-popout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.admin-sidebar-popout-item:hover:not(.is-disabled) {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.2);
}

.admin-sidebar-popout-item.is-active {
  background: rgba(29, 78, 216, 0.35);
  border-color: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
}

.admin-sidebar-popout-item.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-sidebar-popout-item .chev {
  opacity: 0.45;
  font-size: 0.75rem;
}

[data-theme="light"] .admin-sidebar {
  background: #f1f5f9;
}

[data-theme="light"] .admin-sidebar-popout {
  background: rgba(255, 255, 255, 0.88);
  border-color: #e2e8f0;
}

[data-theme="light"] .admin-sidebar-section {
  color: #64748b;
}

[data-theme="light"] .admin-sidebar-section.is-active {
  color: #0f172a;
}


/* Header brand sits in the same column as the Main Rail */
.admin-header,
.admin-footer {
  background: var(--bg-elevated);
}

.admin-footer {
  border-top: 1px solid var(--border);
}

.admin-header {
  --sb-width: 3.35rem;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  height: 4rem;
  width: 100%;
}
.admin-header-brand-rail {
  flex: 0 0 var(--sb-width, 3.35rem);
  width: var(--sb-width, 3.35rem);
  max-width: var(--sb-width, 3.35rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.admin-header-brand-rail img {
  height: 2.15rem;
  width: 2.15rem;
  border-radius: 9999px;
  object-fit: contain;
}
.admin-header-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem 0 0.85rem;
}
.admin-header-wordmark {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
/* Dashboard fill lives in admin-dashboard.css */
