:root {
  --bg: #14171c;
  --surface: #1b1f27;
  --surface-raised: #232833;
  --border: #2c3240;
  --text: #edeae3;
  --text-muted: #8b92a3;
  --accent: #3a6c8d;
  --accent-dim: #2c5570;
  --accent-green: #87b42b;
  --danger: #e8636f;
  --font-display: 'Open Sans', 'Segoe UI', sans-serif;
  --font-body: 'PT Sans', 'Segoe UI', sans-serif;
  --radius: 14px;
  --tile-min: 168px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(58, 108, 141, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 0%, rgba(135, 180, 43, 0.10), transparent 60%);
  background-attachment: fixed;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.35em;
  letter-spacing: -0.02em;
}

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

.hub-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.1rem 2rem;
}

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.25rem;
}

.hub-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.hub-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  background: transparent;
}

.hub-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hub-brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.hub-brand-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hub-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.hub-logout:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.hub-user-menu.user-menu { position: relative; }

.user-menu-trigger {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-trigger img { width: 100%; height: 100%; object-fit: cover; }

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 6px;
  z-index: 120;
}

.user-menu-dropdown.open { display: block; }

.user-menu-name {
  display: grid;
  gap: 0.1rem;
  padding: 8px 10px 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.user-menu-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}

.user-menu-dropdown a:hover {
  background: var(--surface-raised);
  text-decoration: none;
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}

.hub-main { flex: 1; }

.hub-footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 2rem;
}

.hub-dev-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #5c3b00;
  color: #ffd27a;
  font-weight: 700;
  font-size: 0.75rem;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.hub-login-card {
  max-width: 460px;
  margin: 2rem auto 0;
}

.hub-lead {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.hub-dev-note {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 210, 122, 0.08);
  border: 1px solid rgba(255, 210, 122, 0.25);
  color: #ffd27a;
  font-size: 0.92rem;
}

.hub-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.hub-alert-error {
  background: rgba(232, 99, 111, 0.12);
  border: 1px solid rgba(232, 99, 111, 0.35);
  color: #ffb4bc;
}

.hub-form {
  display: grid;
  gap: 1rem;
}

.hub-field {
  display: grid;
  gap: 0.35rem;
}

.hub-field span {
  font-weight: 700;
  font-size: 0.95rem;
}

.hub-field input {
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
}

.hub-field input:focus {
  outline: 2px solid rgba(58, 108, 141, 0.55);
  border-color: var(--accent);
}

.hub-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hub-btn-primary {
  background: var(--accent);
  color: #fff;
}

.hub-btn-primary:hover {
  background: var(--accent-dim);
}

.hub-btn-large {
  min-height: 52px;
  font-size: 1.05rem;
}

.hub-dashboard {
  display: grid;
  gap: 1.5rem;
}

.hub-dashboard--grouped {
  gap: 2rem;
}

.hub-category {
  display: grid;
  gap: 0.85rem;
}

.hub-category-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hub-welcome {
  padding: 0.25rem 0;
}

.hub-empty {
  color: var(--text-muted);
  padding: 1rem 0;
}

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

.hub-tile-wrap {
  position: relative;
  display: flex;
}

.hub-tile-wrap .hub-tile {
  flex: 1;
  width: 100%;
}

.hub-tile-fav-form {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
}

.hub-fav-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.hub-fav-btn.is-on {
  color: #e6c35c;
  border-color: rgba(230, 195, 92, 0.45);
}

.hub-tile {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 190px;
  padding: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-tile.is-favorite {
  border-color: rgba(230, 195, 92, 0.35);
}

.hub-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  text-decoration: none;
}

.hub-tile.is-soon {
  opacity: 0.72;
  cursor: default;
}

.hub-tile.is-soon:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.hub-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: rgba(58, 108, 141, 0.18);
  border: 1px solid rgba(58, 108, 141, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.hub-tile-icon--image {
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.hub-tile-icon--image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}

/* Externe Favicons: gleicher Rahmen wie Marken-Icons */
.hub-tile-icon--favicon {
  background: #3a6c8d;
  border: none;
  padding: 7px;
  box-sizing: border-box;
}

.hub-tile-icon--favicon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}

.hub-tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.hub-tile-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.hub-tile-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

.hub-tile-access {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.hub-tile-access-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hub-tile-access-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.hub-access-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: rgba(135, 180, 43, 0.16);
  color: #c8e887;
  font-size: 0.72rem;
  font-weight: 700;
}

.hub-access-chip--admin {
  background: rgba(230, 195, 92, 0.14);
  color: #e6c35c;
}

.hub-tile-meta {
  margin-top: auto;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.hub-pill-action {
  background: rgba(135, 180, 43, 0.16);
  color: #c8e887;
}

.hub-pill-muted {
  background: rgba(139, 146, 163, 0.16);
  color: var(--text-muted);
}

.icon-slides .hub-tile-icon::before { content: "▦"; }
.icon-calendar .hub-tile-icon::before { content: "📅"; }
.icon-signage .hub-tile-icon::before { content: "🖥"; }
.icon-event .hub-tile-icon::before { content: "▶"; }
.icon-lab .hub-tile-icon::before { content: "⚗"; }
.icon-default .hub-tile-icon::before { content: "⚒"; }
.hub-tile-icon--favicon::before,
.hub-tile-icon--image::before { content: none !important; }

@media (max-width: 640px) {
  .hub-shell { padding: 0.75rem 0.85rem 1.5rem; }
  .hub-header { align-items: flex-start; flex-direction: column; }
  .hub-tiles { grid-template-columns: 1fr; }
}
