/* NOBOUND App Shell (Figma "NB© Control Center"): Tokens, globale Navigation,
 Context Header, Buttons, Menüs – gemeinsam für Cockpit (Command Centre)
 und Flow Builder. Quelle: editor.html (Phase 1). */
.af {
  --af-nav: #202326; --af-charcoal: #292928; --af-mid: #737371; --af-light: #ededeb;
  --af-workspace: #fafaf9; --af-white: #fff;
  --af-shadow: 0 2px 6px rgba(41,41,40,0.04), 0 8px 24px rgba(41,41,40,0.08);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#shell.af { display: flex; flex-direction: row; height: 100vh; overflow: hidden; background: var(--af-workspace); }
.af [hidden] { display: none !important; }

/* Global Navigation */
#af-nav { width: 176px; flex: none; background: var(--af-nav); padding: 12px; display: flex; flex-direction: column; justify-content: space-between; transition: width 150ms ease; }
.af-nav-upper { display: flex; flex-direction: column; gap: 16px; }
.af-nav-top { height: 48px; display: flex; align-items: center; justify-content: space-between; }
.af-nb-icon { width: 32px; height: 32px; display: block; }
.af-nav-collapse { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.af-nav-collapse:hover { background: rgba(255,255,255,0.07); }
.af-nav-main { display: flex; flex-direction: column; gap: 16px; }
.af-nav-back { height: 32px; padding: 0 8px; display: flex; align-items: center; gap: 8px; border-radius: 6px; text-decoration: none;
  font: 500 12px/16px "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgba(255,255,255,0.6); }
.af-nav-back:hover { background: rgba(255,255,255,0.05); }
.af-nav-section { display: flex; flex-direction: column; }
.af-nav-context { height: 32px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 500 12px/16px "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgba(255,255,255,0.6); }
.af-nav-local { display: flex; flex-direction: column; gap: 4px; }
.af-nav-item { height: 40px; width: 100%; padding: 0 8px; display: flex; align-items: center; gap: 8px; border-radius: 6px; border: 0; background: transparent;
  text-decoration: none; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden;
  font: 500 13px/16px "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgba(255,255,255,0.6); }
.af-nav-item img { flex: none; }
.af-nav-item:hover { background: rgba(255,255,255,0.05); }
.af-nav-item.active, .af-account { background: rgba(255,255,255,0.07); color: #fff; }
.af-nav-bottom { position: relative; }
.af-account-menu { bottom: 48px; left: 0; width: 200px; }
#shell.af-nav-collapsed #af-nav { width: 56px; }
#shell.af-nav-collapsed .af-nav-item span, #shell.af-nav-collapsed .af-nav-back span, #shell.af-nav-collapsed .af-nav-context { display: none; }
#shell.af-nav-collapsed .af-nav-top { flex-direction: column; height: auto; gap: 8px; }
#shell.af-nav-collapsed .af-nav-collapse img { transform: scaleX(-1); }

#af-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

/* Context Header */
.af #crumbbar { height: 48px; flex: none; padding: 0 32px 0 32px; background: var(--af-white); border-bottom: 1px solid var(--af-light);
  font: 400 12px/16px "Inter", sans-serif; color: var(--af-mid); display: flex; align-items: center; justify-content: space-between; }
.af #crumbbar .crumb { display: flex; align-items: center; gap: 0; white-space: nowrap; overflow: hidden; }
.af #crumbbar .crumb .sep { margin: 0 6px; color: var(--af-mid); }
.af #crumbbar .crumb b { margin-left: 4px; color: var(--af-charcoal); font-weight: 500; }
.af #crumbbar .right { position: relative; display: flex; align-items: center; gap: 8px; }
.af-btn { height: 32px; min-width: 104px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--af-charcoal); background: var(--af-charcoal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font: 500 12px/16px "Inter", sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.af-btn.secondary { background: var(--af-white); border-color: var(--af-light); color: var(--af-charcoal); }
.af-btn:hover { filter: brightness(0.96); }
.af-icon-btn { width: 32px; height: 32px; flex: none; padding: 0; border-radius: 6px; border: 1px solid var(--af-light); background: var(--af-white);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.af-icon-btn:hover { background: var(--af-workspace); }
.af-icon-btn:disabled { opacity: 0.4; cursor: default; }

/* Menüs */
.af-menu { position: absolute; z-index: 60; background: var(--af-white); border: 1px solid var(--af-light); border-radius: 8px; box-shadow: var(--af-shadow); padding: 6px; display: flex; flex-direction: column; min-width: 200px; }
.af-more-menu { top: 40px; right: 0; }
.af-menu-item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px;
  font: 500 12px/16px "Inter", sans-serif; color: var(--af-charcoal); text-decoration: none; cursor: pointer; text-align: left; }
.af-menu-item:hover { background: var(--af-workspace); }
.af-menu-row { padding: 6px 10px 8px; border-bottom: 1px solid var(--af-light); margin-bottom: 4px; }
.af-kbd { color: var(--af-mid); font-weight: 400; }
/* Release-Zeile im Account-Menü (release.js) */
.nb-release { padding: 6px 10px 4px; margin-top: 4px; border-top: 1px solid var(--af-light); font: 400 11px/16px "Inter", sans-serif; color: var(--af-mid); font-variant-numeric: tabular-nums; user-select: text; }

/* Firmenwechsler (mehrere Firmen pro Benutzer) */
.af-nav-context.af-ctx-switch { cursor: pointer; border-radius: 6px; }
.af-nav-context.af-ctx-switch:hover { background: rgba(255,255,255,0.07); color: #fff; }
.af-ctx-caret { margin-left: 4px; opacity: 0.6; font-size: 10px; }
.af-ctx-menu .af-ctx-head { padding: 6px 10px 4px; font: 500 11px/16px "Inter", sans-serif; color: #737371; }
.af-ctx-menu .af-menu-item { display: flex; justify-content: space-between; gap: 12px; }
.af-ctx-menu .af-menu-item.active { font-weight: 500; }
.af-ctx-plan { color: #737371; font-size: 11px; }

.af-ctx-menu { background: #fff; border: 1px solid #ededeb; border-radius: 8px; padding: 4px; box-shadow: 0 2px 6px rgba(41,41,40,0.04), 0 8px 24px rgba(41,41,40,0.12); font: 400 12px/16px "Inter", sans-serif; color: #292928; }
.af-ctx-menu .af-menu-item { width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.af-ctx-menu .af-menu-item:hover { background: #f3f3f1; }
