/* ─── Desktop Layout ─────────────────────────────────────────────────────────
   Aktiviert ab 1024px Breite: persistente Seitenleiste + Content-Bereich.
   Mobile: alles unsichtbar/deaktiviert (kein Layout-Bruch).
──────────────────────────────────────────────────────────────────────────── */

/* Shell-Wrapper — auf Mobile nur ein Pass-through */
#app-shell {
  display: block;
  width: 100%;
}

/* Sidebar versteckt auf Mobile */
.ds-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  /* Vollflächiges zwei-Spalten-Layout */
  #app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
  }

  /* ─── Sidebar ─── */
  .ds-sidebar {
    display: flex;
    flex-direction: column;
    width: 248px;
    min-width: 248px;
    height: 100vh;
    background: var(--card);
    border-right: 0.5px solid var(--divider);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    z-index: 100;
  }

  /* Content scrollbar */
  #app {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
  }

  /* Seiten bekommen max-width und padding auf Desktop */
  .ac-page {
    max-width: 720px;
    margin: 0 auto;
  }

  /* ─── Sidebar: Logo-Bereich ─── */
  .ds-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 16px;
    border-bottom: 0.5px solid var(--divider);
  }

  .ds-brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .ds-brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ds-brand__name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
  }

  .ds-brand__tag {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
  }

  /* ─── Sidebar: Credit-Badge ─── */
  .ds-credits {
    margin: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 204, 0, 0.08);
    border: 0.5px solid rgba(255, 204, 0, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
  }

  .ds-credits:hover {
    background: rgba(255, 204, 0, 0.14);
  }

  .ds-credits__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 204, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .ds-credits__label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .ds-credits__value {
    font-size: 18px;
    font-weight: 800;
    color: var(--yellow);
    line-height: 1;
  }

  /* ─── Sidebar: Navigation ─── */
  .ds-nav {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .ds-nav__section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 10px 4px;
  }

  .ds-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family);
    transition: background 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
  }

  .ds-nav__item:hover {
    background: var(--surface);
    color: var(--text);
  }

  .ds-nav__item.is-active {
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent);
  }

  .ds-nav__item.is-active .ds-nav__icon {
    color: var(--accent);
  }

  .ds-nav__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .ds-nav__label {
    flex: 1;
  }

  .ds-nav__badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
  }

  /* ─── Sidebar: Divider ─── */
  .ds-divider {
    height: 0.5px;
    background: var(--divider);
    margin: 8px 14px;
  }

  /* ─── Sidebar: Footer ─── */
  .ds-footer {
    padding: 12px 14px 20px;
    border-top: 0.5px solid var(--divider);
  }

  .ds-footer__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background 0.12s;
  }

  .ds-footer__user:hover {
    background: var(--surface);
  }

  .ds-footer__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 0.5px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
  }

  .ds-footer__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ds-footer__email {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ds-version {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0 0;
    opacity: 0.5;
  }
}

/* ─── Sehr breite Bildschirme: zweispaltiges Result-Layout ──────────────── */
@media (min-width: 1400px) {
  .ac-page {
    max-width: 900px;
  }
}
