/* Button-Komponenten.
   Nutzung: <button class="btn btn-primary">…</button>
   Varianten: primary, secondary, ghost, danger.
   Größen: btn-sm (Standard = mittel), btn-lg.
   Zustände: [disabled] bzw. .is-disabled, .is-loading. */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition),
                border-color var(--transition),
                color var(--transition),
                box-shadow var(--transition),
                transform var(--transition);
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:active:not([disabled]):not(.is-disabled) {
    transform: translateY(1px);
}

.btn[disabled],
.btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #951f2f;
    border-color: #951f2f;
    color: var(--white);
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.85rem 1.4rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Button-Gruppe mit konstantem Abstand. */
.btn-row {
    display: inline-flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}


/* Form-Komponenten.
   Struktur: <div class="form-group"> <label class="form-label">…</label>
              <input class="form-input" …> <div class="form-help">…</div> </div>
   Fehlerzustand: .has-error auf .form-group oder .form-input selbst. */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-label-sub {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%235b6b85' stroke-width='1.5' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input[disabled],
.form-select[disabled],
.form-textarea[disabled] {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-help {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-error {
    font-size: 0.82rem;
    color: var(--danger);
}

.has-error .form-input,
.has-error .form-select,
.has-error .form-textarea,
.form-input.has-error,
.form-select.has-error,
.form-textarea.has-error {
    border-color: var(--danger);
}

.has-error .form-input:focus,
.has-error .form-select:focus,
.has-error .form-textarea:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

/* Checkbox und Radio: Box + Label nebeneinander. */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 0.25rem 0;
    cursor: pointer;
    font-size: 0.95rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-top: 0.2rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    flex: 1;
    line-height: 1.4;
}

.form-check-sub {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Horizontales Layout: Label links, Feld rechts (ab mittlerer Breite). */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}
@media (min-width: 720px) {
    .form-row-2 { grid-template-columns: 1fr 1fr; }
}

/* Aktionsleiste am Formular-Ende. */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}


/* Daten-Tabellen.
   Nutzung: <table class="data-table"> … </table>
   Modifikatoren: .data-table-compact (dichtere Zeilen),
                  .data-table-zebra (Zebra-Streifen),
                  .data-table-hover (Hover-Markierung). */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table thead th.is-sortable {
    cursor: pointer;
    user-select: none;
}

.data-table thead th.is-sortable:hover {
    color: var(--primary);
}

.data-table thead th .sort-indicator {
    margin-left: var(--space-xs);
    opacity: 0.6;
    font-size: 0.75rem;
}

.data-table tbody td {
    color: var(--text);
}

.data-table .cell-muted {
    color: var(--text-muted);
}

.data-table .cell-right {
    text-align: right;
}

.data-table .cell-nowrap {
    white-space: nowrap;
}

.data-table .cell-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.data-table-compact th,
.data-table-compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.data-table-zebra tbody tr:nth-child(even) td {
    background: var(--bg);
}

.data-table-hover tbody tr {
    transition: background var(--transition);
}

.data-table-hover tbody tr:hover td {
    background: var(--primary-light);
}

/* Horizontal scrollbar Wrapper bei schmalen Viewports. */
.table-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
}

/* Leerzustand innerhalb einer Tabelle. */
.data-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-xl);
    font-style: italic;
}


/* Status-Pills / Badges.
   Nutzung: <span class="badge badge-success">Aktiv</span>
   Varianten: neutral (Default), info, success, warning, danger.
   Modifikator: .badge-outline für dezenter umrandete Variante,
                .badge-dot für vorangestellten Farbpunkt. */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    background: var(--border);
    color: var(--text);
    white-space: nowrap;
}

.badge-info {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: #8a6a1e;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
}

.badge-outline.badge-info    { color: var(--primary); }
.badge-outline.badge-success { color: var(--success); }
.badge-outline.badge-warning { color: #8a6a1e; }
.badge-outline.badge-danger  { color: var(--danger); }

.badge-dot::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}


/* Alerts / Banner.
   Nutzung:
     <div class="alert alert-warning">
         <div class="alert-title">Achtung</div>
         <div class="alert-body">Meldungstext…</div>
     </div>
   Varianten: info, success, warning, danger. */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--bg);
    color: var(--text);
    margin-bottom: var(--space-md);
}

.alert-icon {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.alert-body {
    color: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
}

.alert-body a {
    color: inherit;
    text-decoration: underline;
}

.alert-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
}
.alert-close:hover { opacity: 1; }

.alert-info {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary-hover);
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success-light);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning-light);
    color: #8a6a1e;
}

.alert-danger {
    background: var(--danger-light);
    border-color: var(--danger-light);
    color: var(--danger);
}

/* Aufklapper für Fehler-Logs in Alerts und Tabellen (Deploy-History etc.). */
.deploy-error-details {
    display: inline-block;
    margin-left: 0.4rem;
}
.deploy-error-details summary {
    cursor: pointer;
    font-size: 0.8rem;
}
.deploy-error-log {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.8rem;
    background: var(--surface-muted, #f0f2f7);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 80ch;
    max-height: 24rem;
    overflow: auto;
}


/* Top-Navbar fuer Apps.
   Nutzung: <nav class="navbar"> ... </nav> am Seitenanfang.
   Struktur: Projektname links, Menue Mitte, HotelFriend-Logo rechts.
   Farben: Gradient --text -> --text-muted, Active-Tab-Underline --accent.
   Logo-Quelle: shared/design/logo/hotelfriend-white.svg (single source of truth).

   Layout-Logik:
     - Breit (>=1024px): Brand links, Menue einzeilig und nowrap in der
       Mitte, Logo rechts. Menue-Links strecken sich auf volle Navbar-Hoehe,
       damit die Active-Underline buendig am unteren Navbar-Rand sitzt.
     - Schmal (<=1023px): Burger-Modus. Brand + Burger in Zeile 1, Logo
       bleibt rechts daneben solange Platz ist. Unter 480px: Logo blendet
       im zugeklappten Zustand aus.
     - Aufgeklappt (schmal + .is-open): Menue-Items fuellen Zeile 2+ und
       wrappen frei, Logo rutscht auf die letzte Zeile und zentriert sich.

   Logo-Hoehe 1.75rem, nah an der Text-x-Hoehe, damit es optisch mit den
   Menue-Labels auf einer Linie sitzt und die Navbar kompakt bleibt. */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, var(--text) 0%, var(--text-muted) 100%);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: stretch;
    gap: var(--space-lg);
    min-height: 56px;
    flex-wrap: nowrap;
}

.nav-project {
    display: flex;
    align-items: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-project:hover {
    color: var(--white);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 0.25rem;
    align-items: stretch;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 0 0.9rem;
    font-size: 0.92rem;
    border-bottom: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    line-height: 1.2;
    white-space: nowrap;
}
.nav-menu a:hover {
    color: var(--white);
    text-decoration: none;
}
.nav-menu a.is-active {
    color: var(--white);
    border-bottom-color: var(--accent);
}

.nav-logo-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.nav-logo {
    height: 1.75rem;
    width: auto;
    display: block;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    align-self: center;
}

@media (max-width: 1023px) {
    .navbar-inner {
        flex-wrap: wrap;
        padding: 0.5rem var(--space-md);
        align-items: center;
        gap: 0 var(--space-md);
    }
    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }
    .nav-logo-wrap {
        order: 3;
    }
    .nav-menu {
        display: none;
        order: 4;
        flex: 0 0 100%;
        width: 100%;
        flex-wrap: wrap;
        align-items: stretch;
        padding: var(--space-sm) 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        gap: 0.1rem 0.25rem;
    }
    .navbar.is-open .nav-menu { display: flex; }
    .nav-menu a {
        padding: 0.5rem 0.7rem;
        border-bottom: 3px solid transparent;
    }
    .navbar.is-open .nav-logo-wrap {
        order: 5;
        flex: 0 0 100%;
        width: 100%;
        justify-content: center;
        padding: var(--space-sm) 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 479px) {
    .navbar:not(.is-open) .nav-logo-wrap {
        display: none;
    }
}


/* Shell-Layout: Sidebar + Hauptbereich, Kacheln, Seitenkopf.
   Gilt für alle Apps, die layout.html erben.

   Sidebar folgt 1:1 der Top-Navbar-Konvention (shared/design/components/navbar.css):
     - Hintergrund: Gradient --text -> --text-muted (vertikal statt horizontal)
     - Aktiver Eintrag: linke Kante 3px --accent (entspricht der Unterkante der Navbar)
     - Text inaktiv: rgba(255,255,255,0.72), Hover/Aktiv: --white
     - Logo unten linksbündig (Abschluss der Leiste, analog „rechts" bei der Navbar)
     - User-Block unten ist ein Link auf /profil — Klick auf Name/Rolle öffnet
       die Mein-Konto-Seite mit Abmelden-Button. Kein Abmelden-Button mehr in
       der Sidebar selbst.
     - Responsive: <1024px Burger-Modus, <480px Logo im zugeklappten Zustand versteckt
     - Scroll-Wrapper .shell-scroll umschließt .shell-nav und .shell-user, sodass
       Name/Rolle bei langer Liste mitscrollen; nur das Logo bleibt fix unten.
     - Scrollbar: hauchdünn (4px), weiß 22%, Track transparent, erscheint nur bei
       Überlauf, Firefox/Chromium gleichermaßen gestylt.
   Keine eigenen Sidebar-Tokens — die Leiste verwendet direkt --text, --text-muted,
   --accent und --white. */

.shell {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 100vh;
}

.shell-sidebar {
    background: linear-gradient(180deg, var(--text) 0%, var(--text-muted) 100%);
    color: rgba(255, 255, 255, 0.72);
    padding: var(--space-lg) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-sm);
}

.shell-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-decoration: none;
    color: var(--white);
    padding: 0 var(--space-md);
}
.shell-brand:hover {
    color: var(--white);
    text-decoration: none;
}

.shell-brand-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.shell-brand-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Scroll-Wrapper umschließt Navigation + User-Block.
   Damit scrollen Name/Rolle bei langer Liste mit; nur Logo bleibt fix.
   Hauchdünne Scrollbar (4px, weiß 22%, Track transparent) erscheint
   ausschließlich bei Überlauf, Firefox/Chromium gleichermaßen. */
.shell-scroll {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: var(--space-lg);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.shell-scroll::-webkit-scrollbar {
    width: 4px;
}
.shell-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.shell-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
}

.shell-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--space-md);
}

.shell-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shell-nav-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 var(--space-md);
    margin-bottom: var(--space-xs);
}

.shell-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 0.55rem var(--space-md);
    font-size: 0.88rem;
    line-height: 1.2;
    border-left: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.shell-nav-item:hover {
    color: var(--white);
    text-decoration: none;
}
.shell-nav-item.is-active {
    color: var(--white);
    border-left-color: var(--accent);
}

/* Mehrdimensionale Navigation, Variante C: die Sichten des aktiven Eintrags
   als Unterpunkte. Der Elternpunkt traegt .is-parent (weiss, halbfett), die
   Sichten liegen in .shell-nav-sub. Bewusst KEINE zusaetzliche Einrueckung —
   ein Markierungs-Zeichen am Label-Anfang (Default „– ", alternativ „↳ ") sitzt
   am normalen linken Rand und markiert die Unterordnung selbst; das spart
   horizontalen Platz. Das Zeichen steht im Markup-Label, ist also frei waehlbar.
   Der aktive Unterpunkt nutzt die normale .is-active-Kante in --accent. */
.shell-nav-item.is-parent {
    color: var(--white);
    font-weight: 600;
}
.shell-nav-sub {
    display: flex;
    flex-direction: column;
}
.shell-nav-sub .shell-nav-item {
    font-size: 0.82rem;
}

.shell-nav-external {
    opacity: 0.6;
    font-size: 0.75rem;
    margin-left: var(--space-sm);
}

.shell-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-md) var(--space-md) var(--space-xs);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}
.shell-user:hover {
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.shell-user-name {
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user-role {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
}

.shell-logo-wrap {
    display: flex;
    justify-content: flex-start;
    padding: var(--space-md) var(--space-md) 0;
}
.shell-logo {
    height: 1.75rem;
    width: auto;
    display: block;
}

.shell-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

@media (max-width: 1023px) {
    .shell {
        grid-template-columns: 1fr;
    }
    .shell-sidebar {
        position: sticky;
        top: 0;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem var(--space-md);
        gap: 0 var(--space-md);
        background: linear-gradient(90deg, var(--text) 0%, var(--text-muted) 100%);
    }
    .shell-brand {
        padding: 0;
        flex-direction: row;
        align-items: baseline;
        gap: var(--space-sm);
    }
    .shell-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }
    .shell-scroll {
        /* Im Burger-Modus löst sich der Scroll-Wrapper auf, damit nav und user
           direkte Kinder der Sidebar bleiben (Toggle-Regeln greifen unverändert). */
        display: contents;
    }
    .shell-logo-wrap {
        order: 3;
        padding: 0;
    }
    .shell-nav {
        display: none;
        order: 4;
        flex: 0 0 100%;
        width: 100%;
        padding: var(--space-sm) 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    .shell-sidebar.is-open .shell-nav { display: flex; }
    .shell-nav-item {
        padding: 0.5rem var(--space-md);
    }
    .shell-user {
        order: 5;
        flex: 0 0 100%;
        width: 100%;
        padding: var(--space-sm) var(--space-md);
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        display: none;
    }
    .shell-sidebar.is-open .shell-user { display: flex; }
}

@media (max-width: 479px) {
    .shell-sidebar:not(.is-open) .shell-logo-wrap {
        display: none;
    }
}

.shell-main {
    padding: var(--space-xl);
    max-width: 1200px;
    width: 100%;
}

/* Mehrdimensionale Navigation (Sidebar + Topbar), Variante B: die zweite Ebene
   (.view-tabs) sitzt in einer duennen, sticky Leiste oben im Hauptbereich.
   .has-topbar nimmt dem Hauptbereich sein Innen-Padding, damit die Leiste
   buendig am oberen Rand sitzt (sonst schwaebe sie um space-xl eingerueckt);
   der eigentliche Seiten-Inhalt wandert in .shell-body und bekommt das Padding
   zurueck. Siehe /styleguide#mehrdimensional. */
.shell-main.has-topbar {
    padding: 0;
    display: flex;
    flex-direction: column;
}
.shell-main.has-topbar > .shell-body {
    padding: var(--space-xl);
    flex: 1 1 auto;
    min-width: 0;
}

/* Sichten-Tabs (.view-tabs): die zweite Navigations-Ebene fuer mehrdimensionale
   Apps — flach und hell, der dunklen Sidebar bewusst untergeordnet. Aktiv =
   Cyan-Underline (--accent), wie bei der Top-Navbar, nur auf hellem Grund.
   Traegt nie Logo oder Projekt-Titel — die leben in der Sidebar bzw. im
   page-header. Die schwere .navbar bleibt Single-Nav-Apps vorbehalten und wird
   nie zweite Leiste. Drei dokumentierte Platzierungen, /styleguide#mehrdimensional:
     A) direkt im Inhalt unter dem page-header (Default),
     B) in .view-tabbar als duenne sticky Leiste (mit .shell-main.has-topbar),
     C) entfaellt — dort wandern die Sichten als .shell-nav-sub in die Sidebar.
   Bei vielen Tabs scrollt die Leiste horizontal statt umzubrechen. */
.view-tabs {
    display: flex;
    gap: var(--space-lg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.view-tabs::-webkit-scrollbar {
    display: none;
}
.view-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.15rem;
    margin-bottom: -1px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.view-tabs a:hover {
    color: var(--text);
    text-decoration: none;
}
.view-tabs a.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Variante B: dieselben Tabs in einer duennen, hellen, sticky Leiste am oberen
   Rand des Hauptbereichs. Das horizontale Padding haelt die Tabs buendig zum
   .shell-body-Inhalt darunter. */
.view-tabbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-xl);
}
.view-tabbar .view-tabs {
    border-bottom: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.page-sub {
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    text-decoration: none;
}

.tile p {
    color: var(--text-muted);
    margin: 0;
}

.tile-external {
    color: var(--primary);
    font-size: 0.85rem;
    margin-top: auto;
}

.start-area {
    margin-bottom: var(--space-xl);
}

.start-area-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 var(--space-md);
}

.placeholder-card {
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--space-xl);
    color: var(--text-muted);
}


/* Basis-Styles für alle Apps. tokens.css davor laden. */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

img, svg {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
}
