:root {
  --wp-admin-bar-offset: 0px;
}

body.admin-bar {
  --wp-admin-bar-offset: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --wp-admin-bar-offset: 46px;
  }
}

.ips-admin-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--wp-admin-bar-offset));
  background: var(--ips-bg-3);
  background-image: linear-gradient(to right, var(--ips-bg-2) 0, var(--ips-bg-2) 280px, var(--ips-bg-3) 280px, var(--ips-bg-3) 100%);
  gap: 0;
  width: 100%;
  margin: 0;
  margin-left: -20px;
  z-index: 10;
}

.ips-admin-shell--overlay {
  position: fixed;
  top: var(--wp-admin-bar-offset);
  left: 160px;
  right: 0;
  bottom: 0;
  margin: 0;
  width: auto;
  min-height: calc(100vh - var(--wp-admin-bar-offset));
  overflow: auto;
  box-sizing: border-box;
  z-index: 99;
}

body.folded .ips-admin-shell--overlay {
  left: 56px;
}

.ips-admin-shell__sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: var(--ips-bg-2);
  color: var(--ips-text);
  padding: 24px 20px;
  box-sizing: border-box;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - var(--wp-admin-bar-offset));
  overflow: visible;
}

.ips-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.ips-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  display: grid;
  place-items: center;
  color: #0b1120;
  font-weight: 800;
  font-size: 13px;
}

.ips-brand__name {
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.ips-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ips-text);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease, border 120ms ease;
  text-align: left;
}

.ips-nav__item:link,
.ips-nav__item:visited {
  color: var(--ips-text);
}

.ips-nav__item.indent {
  padding-left: 28px;
}

.ips-nav__item:hover {
  background: #364152;
  border-color: rgba(255, 255, 255, 0.06);
}

.ips-nav__item.is-active {
  background: #475467;
  color: var(--ips-accent);
  border-color: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.ips-nav__item.is-collapsible.is-expanded:not(.is-active) {
  background: #3a475c;
  color: #e5e7eb;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

.ips-nav__item.is-collapsible.is-active {
  position: relative;
  background: #323d4c;
  color: var(--ips-text);
  border-color: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.ips-nav__item:focus {
  outline: none;
}

.ips-nav__item:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.ips-help {
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ips-help a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

.ips-help a:hover {
  color: #fff;
}

.ips-help__title {
  font-weight: 700;
  color: #e2e8f0;
}

.ips-help__subtitle {
  font-size: 12px;
  color: #cbd5e1;
}

.ips-help__link {
  padding: 4px 0;
}

.ips-admin-shell__content {
  flex: 1;
  min-width: 0;
  padding: calc(28px + var(--wp-admin-bar-offset)) 36px 28px;
  box-sizing: border-box;
  background: var(--ips-bg-3);
  min-height: calc(100vh - var(--wp-admin-bar-offset));
}

.ips-mobile-toggle {
  display: none;
  margin-bottom: 12px;
}

.ips-mobile-toggle__btn {
  align-items: center;
  gap: 8px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  color: #111827;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  width: 100%;
}

.ips-admin-shell__overlay-bg {
  display: none;
}

.ips-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}

.ips-page-header h1 {
  margin: 0;
  font-size: 22px;
  color: #0f172a;
}

.ips-card {
  background: var(--ips-card);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

/* Responsive Verhalten: Sidebar einklappbar auf kleinen Screens */
@media (max-width: 991px) {
  .ips-admin-shell {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    background-image: none;
  }

  .ips-admin-shell__sidebar {
    position: fixed;
    top: var(--wp-admin-bar-offset);
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 150ms ease;
    width: 240px;
    flex-basis: 240px;
    overflow-y: auto;
    min-height: calc(100vh - var(--wp-admin-bar-offset));
    z-index: 1000;
  }

  .ips-admin-shell__sidebar.is-open {
    transform: translateX(0);
  }

  .ips-admin-shell--overlay {
    position: absolute;
    top: var(--wp-admin-bar-offset);
    left: 0;
    right: 0;
    width: 100%;
    min-height: calc(100vh - var(--wp-admin-bar-offset));
    padding-left: 0;
    overflow: visible;
  }

  .ips-admin-shell__content {
    padding: calc(16px + var(--wp-admin-bar-offset)) 16px 16px;
    min-height: calc(100vh - var(--wp-admin-bar-offset));
  }

  .ips-mobile-toggle {
    display: inline-flex;
  }

  .ips-admin-shell__overlay-bg {
    display: block;
    position: fixed;
    top: var(--wp-admin-bar-offset);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 900;
  }
}
