:root {
  --bg1: #eef2f7; --bg2: #e2e8f0; --surface: #ffffff; --text: #0f172a;
  --muted: #64748b; --border: #e2e8f0; --primary: #2563eb; --green: #16a34a;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(15,23,42,.07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg1: #0b1220; --bg2: #0f172a; --surface: #1e293b; --text: #e2e8f0;
    --muted: #94a3b8; --border: #334155; --shadow: 0 1px 3px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2)); color: var(--text);
  min-height: 100vh;
}
.muted { color: var(--muted); }

/* ── Login (Split-Screen Brand-Hero) ── */
.login-screen {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg1);
}
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-hero { display: none !important; }
}

/* Linke Brand-Hero-Spalte */
.login-hero {
  position: relative; overflow: hidden;
  background: #0f1a3a;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 48px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Verlauf + Dot-Pattern in einem absoluten Layer (saubere Text-Komposition) */
.login-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 1.5px) 0 0/22px 22px,
    radial-gradient(1200px 600px at -10% -20%, rgba(56,189,248,.35), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(99,102,241,.35), transparent 55%),
    linear-gradient(135deg, #0f1a3a 0%, #1e3a8a 40%, #1d4ed8 100%);
}
.login-hero-inner {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 32px;
}

/* Logo + Wortmarke oben — groß, mittig */
.login-hero-brand {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  align-self: center; text-align: center;
}
.login-hero-logo {
  width: 140px; height: 140px; padding: 20px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 30px; backdrop-filter: blur(8px);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.30));
}
.login-hero-brandname {
  font-size: 26px; font-weight: 800; letter-spacing: .2px; opacity: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,.20);
}

/* Headline */
.login-hero-eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: #93c5fd; margin-bottom: 14px;
}
.login-hero-title {
  font-size: 40px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.08;
  margin: 0;
}
.login-hero-sub {
  font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.78);
  margin: 18px 0 0;
}

/* Feature-Pills */
.login-hero-features {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.login-hero-features li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.92);
}
.hero-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 14px;
}

.login-hero-foot {
  font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: auto;
}

/* Rechte Login-Spalte */
.login-pane {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 32px; position: relative;
  background: var(--bg1);
  overflow: hidden;
  isolation: isolate;
}
/* Aurora — als echte Divs (zuverlässig sichtbar in jedem Browser-Stacking) */
.aurora {
  position: absolute; pointer-events: none;
  border-radius: 50%; filter: blur(90px);
  will-change: transform, opacity;
  z-index: 0;
}
.aurora-a {
  width: 760px; height: 760px;
  background: radial-gradient(circle, rgba(37,99,235,.85) 0%, rgba(37,99,235,.45) 35%, transparent 70%);
  top: -140px; left: -140px;
  animation: aurora-a 34s ease-in-out infinite alternate;
}
.aurora-b {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(14,165,233,.80) 0%, rgba(14,165,233,.40) 35%, transparent 70%);
  bottom: -180px; right: -160px;
  animation: aurora-b 42s ease-in-out infinite alternate;
}
.aurora-c {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,.55) 0%, rgba(99,102,241,.25) 40%, transparent 70%);
  top: 45%; left: 55%; transform: translate(-50%, -50%);
  animation: aurora-c 50s ease-in-out infinite alternate;
}
@keyframes aurora-a {
  0%   { transform: translate3d(-60px, -20px, 0) scale(1);    opacity: .95; }
  50%  { transform: translate3d( 60px,  80px, 0) scale(1.15); opacity: 1;   }
  100% { transform: translate3d(120px, -10px, 0) scale(1.05); opacity: .90; }
}
@keyframes aurora-b {
  0%   { transform: translate3d( 20px,  30px, 0) scale(1);    opacity: .90; }
  50%  { transform: translate3d(-80px, -60px, 0) scale(1.1);  opacity: 1;   }
  100% { transform: translate3d(-30px,  80px, 0) scale(.95);  opacity: .85; }
}
@keyframes aurora-c {
  0%   { transform: translate(-60%, -50%) scale(1);    opacity: .80; }
  50%  { transform: translate(-40%, -60%) scale(1.15); opacity: 1;   }
  100% { transform: translate(-55%, -40%) scale(1.05); opacity: .85; }
}
@media (prefers-color-scheme: dark) {
  .aurora-a { background: radial-gradient(circle, rgba(59,130,246,.60) 0%, rgba(59,130,246,.30) 35%, transparent 70%); }
  .aurora-b { background: radial-gradient(circle, rgba(14,165,233,.50) 0%, rgba(14,165,233,.25) 35%, transparent 70%); }
  .aurora-c { background: radial-gradient(circle, rgba(129,140,248,.40) 0%, rgba(129,140,248,.18) 40%, transparent 70%); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none; }
}
.login-card, .login-pane-foot { position: relative; z-index: 1; }

.login-pane-foot { position: absolute; bottom: 18px; font-size: 11.5px; opacity: .75; z-index: 1; }

.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.08);
  padding: 38px 36px; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 16px;
  animation: card-in .35s cubic-bezier(.2,.7,.3,1.1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.login-card.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.login-logo { width: 64px; height: auto; margin: 0 auto 4px; display: block; }
.login-logo-mobile { display: none; }
@media (max-width: 880px) { .login-logo-mobile { display: block; } }

.login-card h1 { font-size: 26px; font-weight: 800; text-align: left; letter-spacing: -0.4px; }
.login-card > .muted { text-align: left; font-size: 14px; margin-top: -10px; margin-bottom: 8px; }

/* SSO-Button (Microsoft — angelehnt an offiziellen MS-Button-Style) */
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 12px 16px; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid #8c8c8c; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.sso-btn:hover { border-color: #2563eb; background: #f5f9ff; }
.sso-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.sso-btn:disabled { opacity: .55; cursor: default; }
.sso-icon { flex-shrink: 0; }
@media (prefers-color-scheme: dark) {
  .sso-btn { border-color: #475569; }
  .sso-btn:hover { background: rgba(37,99,235,.10); }
}

.sso-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
  margin: 6px 0 2px;
}
.sso-divider::before, .sso-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px;
  background: var(--bg1); color: var(--text); font-size: 14.5px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-card input::placeholder { color: var(--muted); opacity: .55; }
.login-card input:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* Passwort-Wrapper mit Augen-Toggle */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); border-radius: 8px;
}
.pw-toggle:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.pw-toggle .ic-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .ic-eye { display: none; }
.pw-toggle[aria-pressed="true"] .ic-eye-off { display: inline; }

.caps-hint { font-size: 12px; color: #b45309; font-weight: 600; }
@media (prefers-color-scheme: dark) { .caps-hint { color: #fbbf24; } }

/* Passwort-Stärke-Meter (Erstanmeldung) */
.pw-meter { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 6px; }
.pw-meter > span {
  display: block; height: 100%; width: 0%; border-radius: 99px;
  background: #ef4444; transition: width .2s, background .2s;
}
.pw-meter[data-score="1"] > span { width: 25%;  background: #ef4444; }
.pw-meter[data-score="2"] > span { width: 50%;  background: #f59e0b; }
.pw-meter[data-score="3"] > span { width: 75%;  background: #84cc16; }
.pw-meter[data-score="4"] > span { width: 100%; background: #16a34a; }
.pw-hint { font-size: 11.5px; line-height: 1.4; margin-top: 4px; display: block; }

.primary-btn {
  margin-top: 8px; padding: 13px; border: none; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 88%, #000));
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.primary-btn:hover { filter: brightness(1.05); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 45%, transparent); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: .65; cursor: default; filter: none; box-shadow: none; }

.login-foot { display: flex; justify-content: center; margin-top: 4px; }
.muted-link { color: var(--muted); font-size: 12.5px; text-decoration: none; font-weight: 600; }
.muted-link:hover { color: var(--primary); text-decoration: underline; }

.login-error {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: 11px; padding: 10px 13px; font-size: 13px;
}
@media (prefers-color-scheme: dark) {
  .login-error { background: rgba(220,38,38,.12); color: #fca5a5; border-color: rgba(220,38,38,.35); }
}

/* ── Portal ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.brand-logo { height: 30px; width: auto; }
.user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.ghost { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.ghost:hover { border-color: var(--primary); color: var(--primary); }

.content { max-width: 960px; margin: 0 auto; padding: 36px 20px 60px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 26px 0 12px; }
.content section:first-child .section-title { margin-top: 0; }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.tile.disabled { opacity: .55; pointer-events: none; }
.tile-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.tile-body h3 { font-size: 16px; font-weight: 700; margin: 4px 0 4px; }
.tile-body p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.badge { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .4px; }
.badge.live { background: #dcfce7; color: #15803d; }
.badge.soon { background: #fef3c7; color: #92400e; }

.widgets { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.card-head { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.aushang-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.aushang-list li { font-size: 13.5px; display: flex; align-items: baseline; gap: 8px; }
.aushang-list li .dot { color: #dc2626; font-weight: 800; }
.aushang-list li .date { color: var(--muted); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.stat-row { display: flex; gap: 24px; }
.stat { display: flex; flex-direction: column; }
.stat.big { align-items: center; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* ── Editor / Bearbeiten-Modus ── */
.primary { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 700; }
.primary:hover { filter: brightness(1.05); }
.edit-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 8px 14px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.add-btn { background: none; border: 1.5px dashed var(--border); color: var(--muted); border-radius: 12px; padding: 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; width: 100%; }
.add-btn:hover { border-color: var(--primary); color: var(--primary); }
.block-tools { display: flex; gap: 4px; margin-left: auto; }
.block-tools button { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; font-size: 13px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.block-tools button:hover { border-color: var(--primary); }
.is-inactive { opacity: .5; }
.info-card p { font-size: 13.5px; color: var(--text); line-height: 1.55; white-space: pre-line; margin-top: 4px; }
.info-card a { color: var(--primary); }
.edit-head { display: flex; align-items: center; gap: 8px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 560px; padding: 22px 24px; }
.modal-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label, .form-grid .full { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; background: var(--bg1); color: var(--text); font-size: 13.5px; font-family: inherit; }
.form-grid input[type=color] { padding: 2px; height: 38px; }
.form-grid .lbl { font-size: 12.5px; font-weight: 600; }
.rollen-box { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.rollen-box label { flex-direction: row; align-items: center; gap: 5px; font-weight: 500; font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Begrüßung, Schnellaktionen, Emoji-Palette, Vorschau ── */
.greeting { margin-bottom: 26px; }
.greeting-title { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.greeting-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-btn { text-decoration: none; background: var(--bg1); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--text); }
.quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.emoji-palette { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.emoji-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.emoji-btn:hover { border-color: var(--primary); background: var(--bg1); }
.prev-select { padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; }
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
