/* Moderation left sidebar — mirrors the Help Center / Admin sidebar shells.
 * Scoped to /moderation so the three sections never collide. The page's
 * horizontal tab strip is hidden and its buttons are driven from this nav.
 * Light-mode overrides use html:not(.dark) because the SPA only toggles
 * the `dark` class (it never adds `light`). */

.moderation-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.moderation-app > header { flex: 0 0 auto; }

/* ------------------------------------------------ mobile section bar */
.moderation-mobile-bar {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  background: var(--ms-panel, #0f172a);
  border-bottom: 1px solid var(--ms-line, #1e293b);
  color: var(--ms-text, #e2e8f0);
}
.moderation-mobile-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.moderation-mobile-title b { font-size: 13px; font-weight: 700; }
.moderation-mobile-title span { font-size: 10px; color: var(--ms-muted, #94a3b8); }
.moderation-mobile-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ms-line, #1e293b);
  border-radius: 9px;
  background: var(--ms-panel-2, #111c31);
  color: var(--ms-muted, #94a3b8);
  cursor: pointer;
}
.moderation-mobile-toggle:hover { color: var(--ms-text, #e2e8f0); }
.moderation-mobile-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------ shell row */
.moderation-body-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

/* The page's own <main> becomes the flexible content pane. Its first child
 * is the moderation shell; it is stretched to the available height instead
 * of using the original 100vh calculation. */
.moderation-app main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: auto;
  padding: 16px 20px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}
.moderation-app main > div {
  width: 100% !important;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.moderation-app main > div > div[class*="h-[calc(100vh-3.5rem)]"],
.moderation-app main > div > .moderation-shell {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0;
}

/* The original horizontal tab strip is replaced by the sidebar. */
.moderation-tabs-strip { display: none !important; }

/* ------------------------------------------------ sidebar */
.moderation-sidebar.e-sidebar {
  position: relative;
  flex: 0 0 260px;
  width: 260px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ms-panel, #0f172a);
  border-right: 1px solid var(--ms-line, #1e293b);
  color: var(--ms-text, #e2e8f0);
  z-index: 30;
}
.moderation-app.sidebar-collapsed .moderation-sidebar.e-sidebar {
  flex-basis: 60px;
  width: 60px;
}

.moderation-sidebar .e-nav-head {
  min-height: 64px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--ms-line, #1e293b);
}
.moderation-sidebar .e-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.moderation-sidebar .sb-brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--ms-acc-soft, rgba(99, 102, 241, .14));
  border: 1px solid color-mix(in srgb, var(--ms-acc, #818cf8) 45%, transparent);
  color: var(--ms-acc, #818cf8);
}
.moderation-sidebar .sb-brand-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moderation-sidebar .sb-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.moderation-sidebar .sb-brand-text b { font-size: 13px; color: var(--ms-text, #e2e8f0); }
.moderation-sidebar .sb-brand-text span { font-size: 11px; color: var(--ms-muted, #94a3b8); }

.moderation-sidebar .e-desktop-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ms-line, #1e293b);
  border-radius: 8px;
  background: var(--ms-panel-2, #111c31);
  color: var(--ms-muted, #94a3b8);
  cursor: pointer;
}
.moderation-sidebar .e-desktop-toggle:hover { color: var(--ms-text, #e2e8f0); }
.moderation-sidebar .e-desktop-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.moderation-sidebar .e-side-search { padding: 10px 12px 4px; }
.moderation-sidebar .e-side-search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  background: var(--ms-panel-2, #111c31);
  border: 1px solid var(--ms-line, #1e293b);
  border-radius: 9px;
}
.moderation-sidebar .e-side-search-box > svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  stroke: var(--ms-muted, #94a3b8);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.moderation-sidebar .e-side-search-box input {
  flex: 1;
  min-width: 0;
  height: 32px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ms-text, #e2e8f0);
  font-size: 12px;
}
.moderation-sidebar .e-side-search-box input::placeholder { color: var(--ms-dim, #7d8ca4); }
.moderation-sidebar .e-side-suggest {
  position: absolute;
  z-index: 70;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  background: var(--ms-panel, #0f172a);
  border: 1px solid var(--ms-line, #1e293b);
  border-radius: 9px;
  padding: 4px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, .28);
}
.moderation-sidebar .e-side-suggest button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ms-text, #e2e8f0);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.moderation-sidebar .e-side-suggest button:hover { background: var(--ms-acc-soft, rgba(99, 102, 241, .14)); }

.moderation-sidebar .moderation-nav {
  flex: 1 1 auto;
  overflow: auto;
  padding: 10px 8px 14px;
}
.moderation-sidebar .e-nav-group { margin-bottom: 14px; }
.moderation-sidebar .e-nav-label.nav-sec {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ms-dim, #7d8ca4);
}
.moderation-sidebar .e-nav .e-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 39px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ms-text, #e2e8f0);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.moderation-sidebar .e-nav .e-nav-item:hover { background: rgba(148, 163, 184, .12); }
.moderation-sidebar .e-nav .e-nav-item.active,
.moderation-sidebar .e-nav .e-nav-item.on {
  background: var(--ms-acc-soft, rgba(99, 102, 241, .14));
  color: var(--ms-acc, #818cf8);
  box-shadow: inset 3px 0 0 var(--ms-acc, #818cf8);
}
.moderation-sidebar .e-nav-icon.ni-ico {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--ms-muted, #94a3b8);
}
.moderation-sidebar .e-nav-item.active .e-nav-icon.ni-ico,
.moderation-sidebar .e-nav-item.on .e-nav-icon.ni-ico { color: var(--ms-acc, #818cf8); }
.moderation-sidebar .e-nav-icon.ni-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moderation-sidebar .e-nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.moderation-sidebar .e-nav-item.active .e-nav-text,
.moderation-sidebar .e-nav-item.on .e-nav-text { font-weight: 700; }

.moderation-nav-backdrop { display: none; }

/* Collapsed rail: only the expand toggle stays visible. */
.moderation-app.sidebar-collapsed .moderation-sidebar .e-brand,
.moderation-app.sidebar-collapsed .moderation-sidebar .sb-brand-text,
.moderation-app.sidebar-collapsed .moderation-sidebar .e-nav-label,
.moderation-app.sidebar-collapsed .moderation-sidebar .e-nav-text,
.moderation-app.sidebar-collapsed .moderation-sidebar .e-side-search { display: none; }
.moderation-app.sidebar-collapsed .moderation-sidebar .e-nav-head {
  justify-content: center;
  padding: 14px 8px;
}
.moderation-app.sidebar-collapsed .moderation-sidebar .e-nav .e-nav-item {
  justify-content: center;
  padding: 8px;
}

/* ------------------------------------------------ light mode */
html:not(.dark) .moderation-app {
  --ms-panel: #ffffff;
  --ms-panel-2: #f8fafc;
  --ms-line: #e2e8f0;
  --ms-text: #0f172a;
  --ms-muted: #475569;
  --ms-dim: #64748b;
  --ms-acc: #4f46e5;
  --ms-acc-soft: rgba(79, 70, 229, .1);
}
html:not(.dark) .moderation-sidebar .e-nav .e-nav-item:hover { background: rgba(15, 23, 42, .06); }
html:not(.dark) .moderation-sidebar .e-side-suggest { box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
html:not(.dark) .moderation-nav-backdrop { background: rgba(15, 23, 42, .32); }

/* ------------------------------------------------ drawer */
@media (max-width: 1439px) {
  .moderation-app .moderation-mobile-bar { display: flex; }
  .moderation-app .moderation-sidebar.e-sidebar {
    position: fixed;
    top: var(--moderation-sidebar-top, 114px);
    left: 0;
    bottom: 0;
    width: min(86vw, 300px);
    height: auto;
    transform: translateX(-105%);
    transition: transform .2s ease;
    z-index: 60;
    box-shadow: 0 16px 38px rgba(2, 6, 23, .34);
  }
  .moderation-app.nav-open .moderation-sidebar.e-sidebar { transform: none; }
  .moderation-app .moderation-nav-backdrop {
    display: none;
    position: fixed;
    top: var(--moderation-sidebar-top, 114px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, .55);
    z-index: 50;
  }
  .moderation-app.nav-open .moderation-nav-backdrop { display: block; }
  .moderation-app .moderation-sidebar .e-nav-head { display: none; }
  .moderation-app .moderation-sidebar .e-desktop-toggle { display: none; }
  .moderation-app main { padding: 8px 10px !important; }
}
@media (min-width: 1440px) {
  .moderation-app .moderation-mobile-bar { display: none; }
  .moderation-app .moderation-nav-backdrop { display: none !important; }
}
