/* HQ-Plattform: globale Kopfzeile (Marke, Apps-Menue, Nutzerzone) – identisch in allen Apps.
   Quelle: /opt/hq-test/shared/hq-platform.css, Kopien nur ueber hq-platform-sync. Wird NACH dem App-Stil geladen.
   Die app-eigenen Reiter (.tabs/.tab) bleiben App-Sache. */

/* Gleiche Hoehe und Abstaende der globalen Leiste in allen Apps */
.topbar { min-height: 68px; height: auto; padding: 0 28px; gap: 24px; }
.topbar .brand { flex: none; text-decoration: none; color: #fff; }

/* Apps-Menue: natives <details>, Links sind normale <a href> (neuer Tab per Strg-/Mittelklick moeglich) */
.hq-apps { position: relative; align-self: center; flex: none; }
.hq-apps-btn { display: inline-flex; align-items: center; gap: 7px; list-style: none; cursor: pointer;
               -webkit-tap-highlight-color: transparent; color: #cfc7bd; border: 1px solid #4a443e; border-radius: 8px;
               padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; user-select: none; }
.hq-apps-btn::-webkit-details-marker { display: none; }
.hq-apps-btn::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border-right: 1.6px solid currentColor;
                      border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.hq-apps[open] > .hq-apps-btn::after { transform: translateY(1px) rotate(-135deg); }
.hq-apps-btn:hover, .hq-apps-btn:focus-visible, .hq-apps[open] > .hq-apps-btn { color: #fff; border-color: var(--gold, #d2a850); outline: none; }
.hq-apps-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.hq-apps-menu { position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; min-width: 232px; padding: 6px;
                display: flex; flex-direction: column; gap: 2px; background: var(--surface, #fff); color: var(--ink, #1f1d1b);
                border: 1px solid var(--line, #e4ddd2); border-radius: 10px;
                box-shadow: 0 1px 2px rgba(31,29,27,.08), 0 10px 28px rgba(31,29,27,.16); }
.hq-app { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px;
          color: var(--ink, #1f1d1b); text-decoration: none; font-size: 14px; font-weight: 600; }
.hq-app:hover, .hq-app:focus-visible { background: var(--sand, #efe8dd); outline: none; }
.hq-app.active { background: #fbf6ea; box-shadow: inset 3px 0 0 var(--gold, #d2a850); }
.hq-app-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px;
               border-radius: 6px; background: var(--anthracite, #1f1d1b); color: var(--gold, #d2a850);
               font-size: 14px; font-weight: 800; }
.hq-app-name { flex: 1; }
.hq-app-here { color: var(--gold-ink, #94722b); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* Nutzerzone rechts: Verbesserung melden · Name · Passwort · Abmelden (gleiche Reihenfolge in allen Apps) */
.topbar .userbox { margin-left: auto; flex: none; display: flex; align-items: center; gap: 14px; color: #cfc7bd; font-size: 13px; }
.topbar .userbox form { margin: 0; }
.topbar .userbox .who { color: #fff; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reiter duerfen schrumpfen und scrollen in sich, statt die Seite zu verbreitern */
.topbar .tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar .tabs::-webkit-scrollbar { display: none; }

@media (max-width: 900px) {
    /* Zeile 1 (52 px): Marke · Apps · Nutzerzone; Zeile 2 (44 px): Fachnavigation, ganze Breite, scrollt in sich */
    .topbar { flex-wrap: wrap; padding: 0 12px; column-gap: 8px; row-gap: 0; min-height: 0; }
    .topbar .brand { min-height: 52px; }
    .topbar .brand strong { font-size: 15px; letter-spacing: .16em; }
    .topbar .brand span { display: block; font-size: 10px; }
    .topbar .userbox { gap: 6px; }
    .topbar .userbox .who, .topbar .userbox .hq-pw, .topbar .updated { display: none; }
    .topbar .tabs { order: 3; width: 100%; height: 44px; border-top: 1px solid rgba(255,255,255,.08); }
    .hq-apps { position: static; }                 /* Menue an der Kopfzeile ausrichten, nicht am Knopf */
    .hq-apps-btn { padding: 7px 8px; }
    .hq-apps-btn span { display: none; }            /* nur Symbol; Beschriftung als title */
    .hq-apps-menu { left: 12px; right: 12px; top: 50px; min-width: 0; }
}
@media (max-width: 360px) {
    .topbar .brand strong { font-size: 13px; letter-spacing: .12em; }
}
@media print {
    .hq-apps { display: none !important; }
}
