/* ============================================================
   shell.css — App-Shell Layout
   REGEL: Keine festen Farbwerte — alles über Variablen
   ============================================================ */

/* ── Login View ─────────────────────────────────────────── */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

/* ── App Shell ──────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Topbar ─────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: var(--z-topbar);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ── Hamburger Button ───────────────────────────────────── */

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--bg3);
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text2);
  border-radius: 999px;
  transition: all var(--transition-normal);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Brand ──────────────────────────────────────────────── */

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  user-select: none;
}

.brand-slash {
  color: var(--accent);
  font-weight: 600;
}

.brand-name {
  color: var(--text);
  font-weight: 500;
}

/* ── Topbar User ────────────────────────────────────────── */

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: var(--z-overlay);
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.hidden {
  display: none !important;
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.sidebar.open {
  transform: translateX(0);
}

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

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  user-select: none;
}

.sidebar-close {
  color: var(--text3);
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.sidebar-close:hover {
  color: var(--text);
  background: var(--bg3);
}

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

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg3);
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: var(--inactive-opacity);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

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

.sidebar-footer {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text3);
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.sidebar-logout:hover {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

/* ── Main Content ───────────────────────────────────────── */

.main-content {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}

/* ── Toast ──────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--bg3) 80%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  backdrop-filter: blur(8px);
  transition: opacity var(--transition-normal);
}

.toast.success {
  border-color: color-mix(in srgb, var(--green) 25%, transparent);
  color: var(--green);
  background: color-mix(in srgb, var(--green) 5%, transparent);
}

.toast.error {
  border-color: color-mix(in srgb, var(--red) 25%, transparent);
  color: var(--red);
  background: color-mix(in srgb, var(--red) 5%, transparent);
}

.toast.warning {
  border-color: color-mix(in srgb, var(--yellow) 25%, transparent);
  color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 5%, transparent);
}

.toast.pending {
  border-color: color-mix(in srgb, var(--blue) 25%, transparent);
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 5%, transparent);
}

.toast.success::before {
  content: "✓";
  font-size: 12px;
}
.toast.error::before {
  content: "✕";
  font-size: 12px;
}
.toast.warning::before {
  content: "!";
  font-size: 12px;
}

.toast.pending::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  animation: toast-pulse 1s ease-in-out infinite;
}

@keyframes toast-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.6);
  }
}

/* ── Modal ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: var(--z-modal);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  z-index: var(--z-modal);
  min-width: 400px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* ── View Wrap ──────────────────────────────────────────── */

.view-wrap {
  padding: var(--space-6);
  color: var(--text);
}
