.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(93, 22, 116, 0.92), rgba(255, 61, 16, 0.9)),
    var(--bg);
}

.app-shell {
  min-height: 100vh;
  background: #eeeeef;
}

/* ── Top bar ────────────────────────────────────────── */

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 26px;
  color: #ffffff;
  background: linear-gradient(100deg, #b91c1c 0%, #dc2626 40%, #ea580c 75%, var(--orange) 100%);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-area,
.top-actions,
.session-box,
.form-actions,
.list-header {
  display: flex;
  align-items: center;
}

.brand-area {
  gap: 26px;
  min-width: 0;
}

.top-logo {
  width: 140px;
  height: 50px;
  border: 0;
  box-shadow: none;
  background: transparent;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.system-name {
  font-size: 1rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.top-actions {
  gap: 16px;
}

.top-icon-button,
.support-button {
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.top-icon-button {
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
}

.support-button {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  padding: 10px 13px;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: #ffffff;
}

.hamburger-icon {
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -7px;
}

.hamburger-icon::after {
  top: 7px;
}

.session-user {
  max-width: 170px;
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Workspace ──────────────────────────────────────── */

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
  transition: grid-template-columns 0.18s ease;
}

.app-shell.menu-collapsed .workspace {
  grid-template-columns: 64px minmax(0, 1fr);
}

/* ── Sidebar ────────────────────────────────────────── */

.sidebar {
  height: calc(100vh - 68px);
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #d7d9de;
  box-shadow: 5px 0 14px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 68px;
  align-self: start;
  z-index: 50;
}

.menu-list {
  display: grid;
  padding: 22px 0 28px;
}

.menu-button {
  width: 100%;
  min-height: 45px;
  display: grid;
  grid-template-columns: 34px 1fr 24px;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 14px 0 12px;
  background: transparent;
  color: #565d66;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  transition: background 0.16s ease, color 0.16s ease;
}

.app-shell.menu-collapsed .menu-button {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.app-shell.menu-collapsed .menu-button span:not(.menu-icon) {
  display: none;
}

.menu-button:hover,
.menu-button.active {
  background: var(--orange);
  color: #ffffff;
}

.menu-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.menu-chevron {
  justify-self: end;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ── Submenu group ──────────────────────────────────── */

.submenu-group {
  display: none;
  flex-direction: column;
  background: #f7f4fa;
  border-left: 3px solid var(--purple);
  margin: 0;
  overflow: hidden;
}

.submenu-group.open {
  display: flex;
}

.submenu-button {
  width: 100%;
  min-height: 38px;
  padding: 0 14px 0 20px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.14s, color 0.14s;
  border-bottom: 1px solid rgba(93,22,116,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.submenu-button:last-child { border-bottom: 0; }

.submenu-button:hover {
  background: rgba(93,22,116,0.07);
  color: var(--purple);
}

.submenu-button.active {
  background: rgba(93,22,116,0.12);
  color: var(--purple);
}

.submenu-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Submenu colapsado ──────────────────────────────── */

.app-shell.menu-collapsed .submenu-group.open {
  display: flex;
}

.app-shell.menu-collapsed .submenu-button {
  padding: 0;
  justify-content: center;
  min-height: 42px;
  font-size: 0;
  letter-spacing: 0;
  gap: 0;
}

.app-shell.menu-collapsed .submenu-icon {
  font-size: 1.2rem;
}

/* ── Content area ───────────────────────────────────── */

.content-stack {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 18px;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 820px) {
  .topbar {
    height: auto;
    min-height: 82px;
    flex-wrap: wrap;
    padding: 14px;
  }

  .system-name {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    overflow: visible;
  }

  .menu-list {
    padding: 8px 0;
  }

  .menu-button {
    border-radius: 0;
  }

  .content-stack {
    padding: 12px;
  }
}
