:root {
  --accent: #b32122;         /* deisterworx Markenrot */
  --accent-hover: #c93435;
  --bg: #0b1220;
  --surface: #141e30;
  --surface-2: #1c283d;
  --border: #27344a;
  --text: #e6ebf3;
  --text-dim: #93a1b8;
}

body.app-shell {
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
  align-items: flex-start;
  display: block;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  font-size: 1rem;
  white-space: nowrap;
}
.app-nav .brand img { height: 30px; width: auto; display: block; }
.app-nav .brand .byline { color: var(--text-dim); font-weight: 500; font-size: 0.78rem; }
/* Markentext ohne Fugenloch: "ShadowBoardCreator" ist ein Wort, der rote
   Teil ("Creator") ist ein <b> ohne eigene Abstände (früher <span> zwischen
   zwei Leerzeichen => sichtbare Lücke mitten im Wort). */
.app-nav .brand-name { color: var(--text); }
.app-nav .brand-name b { color: var(--accent); font-weight: inherit; }
.app-nav nav { display: flex; gap: 0.3rem; flex: 1; }
.app-nav nav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.85rem;
  padding: 0.45rem 0.8rem; border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.app-nav nav a:hover { background: var(--surface-2); color: var(--text); }
.app-nav nav a.active { background: var(--accent); color: white; }
@media (max-width: 640px) {
  /* Kompakte Ein-Zeilen-Navigation: Marke links, scrollbarer Tab-Bereich in der
     Mitte, Avatar rechts. Vorher brach die Leiste in 3 Zeilen um und fraß auf
     dem Handy ~136px von jedem Screen. */
  .app-nav { flex-wrap: nowrap; gap: 0.5rem; padding: 0.55rem 0.8rem; }
  /* Auf dem Handy nur das Logo als Marke: der Text "ShadowBoardCreator"
     frisst sonst die halbe Leiste (font-size:0 versteckt den freien Textknoten). */
  .app-nav .brand { font-size: 0; gap: 0.3rem; }
  .app-nav .brand .byline { display: none; }
  .app-nav .brand-name { display: none; }
  .app-nav .brand img { height: 26px; }
  .app-nav nav { order: 0; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .app-nav nav::-webkit-scrollbar { display: none; }
  .app-nav nav a { white-space: nowrap; flex-shrink: 0; min-height: 40px; display: inline-flex; align-items: center; }
  .app-nav .user-chip-btn span:not(.caret) { display: none; }
  .app-nav .user-chip-btn { padding: 0.2rem; }
}
.app-nav .user-menu { position: relative; }
.app-nav .user-chip-btn {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--text-dim);
  background: none; border: none; cursor: pointer; padding: 0.3rem 0.4rem; border-radius: 6px;
}
.app-nav .user-chip-btn:hover { background: var(--surface-2); }
.app-nav .user-chip-btn .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: white; font-weight: 600;
}
.app-nav .user-chip-btn .caret { font-size: 0.65rem; color: var(--text-dim); }
.app-nav .user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  min-width: 160px; overflow: hidden; z-index: 30; flex-direction: column;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.app-nav .user-dropdown.open { display: flex; }
.app-nav .user-dropdown a, .app-nav .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 0.6rem 0.9rem;
  background: none; border: none; color: var(--text); text-decoration: none;
  font-size: 0.83rem; cursor: pointer; box-sizing: border-box;
}
.app-nav .user-dropdown a:hover, .app-nav .user-dropdown button:hover { background: var(--surface); }
.app-nav .user-dropdown button { border-top: 1px solid var(--border); color: #f87171; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.6rem 3rem;
}
.page-header { margin-bottom: 1.8rem; }
.page-header h1 { font-size: 1.5rem; margin: 0 0 0.3rem; color: var(--text); }
.page-header p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.section-card h2 { font-size: 1rem; margin: 0 0 1rem; color: var(--text); }

/* Formulare in Karten: einheitlich, touch-gerecht (>=44px Ziele), ohne Inline-Styles */
.profile-form label, .section-card form label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.7rem 0 0.3rem;
}
.profile-form input, .section-card form input,
.profile-form select, .section-card form select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}
.profile-form input:disabled {
  background: var(--bg);
  color: #64748b;
}
.profile-form button[type=submit], .section-card form button[type=submit] {
  margin-top: 1.1rem;
  min-height: 44px;
  padding: 0.55rem 1.4rem;
  background: var(--brand);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}
.profile-form button[type=submit]:hover, .section-card form button[type=submit]:hover {
  background: var(--brand-hover);
}
.profile-form .msg { margin-top: 0.6rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.dash-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, transform 0.15s;
}
.dash-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.dash-tile .icon { font-size: 1.6rem; }
.dash-tile .title { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.dash-tile .desc { color: var(--text-dim); font-size: 0.8rem; line-height: 1.4; }

.app-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.app-footer .footer-logo { height: 22px; width: auto; opacity: 0.85; }
.app-footer .footer-copyright { flex: 1; }
.app-footer .footer-links { display: flex; gap: 1rem; }
.app-footer .footer-links a { color: var(--text-dim); text-decoration: none; }
.app-footer .footer-links a:hover { color: var(--text); text-decoration: underline; }
