/* ======================================================================
   Kreatief Connect – Stylesheet
   Eigenständiges, modernes Design ohne externe Abhängigkeiten.
   ====================================================================== */

:root {
  --primary: #ea580c;
  --primary-600: color-mix(in srgb, var(--primary), white 10%);
  --primary-50:  color-mix(in srgb, var(--primary), white 92%);
  --primary-100: color-mix(in srgb, var(--primary), white 86%);
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --bg: #f5f5fb;
  --card: #ffffff;
  --text: #1f2233;
  --muted: #6b7185;
  --line: #e7e7f0;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber-text: #b45309;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 60, .04), 0 8px 24px rgba(28, 25, 60, .06);
  --shadow-lg: 0 12px 40px rgba(28, 25, 60, .14);
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
input, textarea, select { font-family: inherit; font-size: 15px; }

/* ---- Boot / Lade-Bildschirm ---------------------------------------- */
.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--muted);
}
.boot-logo { font-size: 56px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }

/* ====================================================================== */
/*  AUTH (Login / Registrierung)                                          */
/* ====================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  background: linear-gradient(150deg, color-mix(in srgb, var(--primary), black 22%) 0%, var(--primary) 52%, color-mix(in srgb, var(--primary), white 18%) 100%);
  color: #fff;
  padding: 56px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: "🎵 🎶 🎼 🎹 🎸 🥁 🎻 🎤";
  position: absolute; inset: 0;
  font-size: 120px; opacity: .07; line-height: 2.4; word-spacing: 40px;
  transform: rotate(-12deg) scale(1.4); pointer-events: none;
}
.auth-hero h1 { font-size: 40px; margin: 0 0 14px; line-height: 1.1; position: relative; }
.auth-hero p { font-size: 18px; opacity: .92; max-width: 380px; line-height: 1.55; position: relative; }
.auth-hero .badge-row { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; position: relative; }
.auth-hero .badge {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; backdrop-filter: blur(4px);
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0 0 6px; font-size: 26px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3a3d52; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100);
}
.field textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--primary-50); color: var(--primary); }
.btn.secondary:hover { background: var(--primary-100); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef0f6; color: var(--text); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: #fecaca; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

.auth-switch { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }
.auth-switch button { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 14px; }

.demo-box { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-box .demo-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.demo-btns { display: grid; gap: 8px; }
.demo-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; text-align: left; transition: border-color .15s, background .15s;
}
.demo-btn:hover { border-color: var(--primary-600); background: var(--primary-50); }
.demo-btn .role-chip { margin-left: auto; }

.form-error { background: var(--red-soft); color: var(--red); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }

/* ====================================================================== */
/*  APP-LAYOUT                                                            */
/* ====================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(140deg, var(--primary), color-mix(in srgb, var(--primary), white 22%)); box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); }
.brand-logo { overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-logo { display: block; width: 74%; max-width: 240px; height: auto; margin: 0 0 22px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: #44485c; font-weight: 600; font-size: 14.5px; border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: #f3f3f9; color: var(--text); }
.nav-item.active { background: var(--primary-50); color: var(--primary); }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
}

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user-mini .name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.user-mini .role { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.content { padding: 30px 36px 80px; max-width: 1080px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; }
.page-head .desc { color: var(--muted); margin: 0; font-size: 15px; }

/* ---- Avatare & Chips ----------------------------------------------- */
.avatar {
  border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700;
  flex-shrink: 0; background: var(--primary); user-select: none;
}
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar.md { width: 44px; height: 44px; font-size: 16px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

.role-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.role-admin { background: var(--accent-soft); color: var(--amber-text); }
.role-teacher { background: var(--primary-50); color: var(--primary); }
.role-student { background: #e0f2fe; color: #0369a1; }

.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef0f6; color: #4b5168; display: inline-flex; align-items: center; gap: 5px; }

/* ---- Karten -------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.grid { display: grid; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---- Dashboard ----------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.stat .ic { font-size: 22px; margin-bottom: 8px; display: block; }

.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.section-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.welcome {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary), white 20%)); color: #fff; border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 26px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.welcome h2 { margin: 0 0 6px; font-size: 23px; }
.welcome p { margin: 0; opacity: .92; }
.welcome::after { content: "🎶"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 76px; opacity: .18; }

/* ---- Listen-Items / News ------------------------------------------- */
.news-item { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-item .news-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news-item h3 { margin: 0; font-size: 17px; }
.news-item .news-body { color: #3a3d52; line-height: 1.55; white-space: pre-wrap; }
.news-item .news-meta { color: var(--muted); font-size: 13px; margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin-flag { color: var(--accent); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* ---- Termine ------------------------------------------------------- */
.event-item { display: flex; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.event-item:last-child { border-bottom: none; }
.event-date {
  flex-shrink: 0; width: 64px; text-align: center; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); align-self: flex-start;
}
.event-date .m { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 0; text-transform: uppercase; }
.event-date .d { font-size: 22px; font-weight: 800; padding: 6px 0 2px; }
.event-date .t { font-size: 11px; color: var(--muted); padding-bottom: 5px; }
.event-main { flex: 1; min-width: 0; }
.event-main h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-main .ev-meta { color: var(--muted); font-size: 13.5px; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.event-main .ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-meta svg, .pin-flag svg { width: 15px; height: 15px; flex-shrink: 0; }
.event-main .ev-desc { color: #3a3d52; line-height: 1.5; font-size: 14.5px; }
.type-konzert { background: #fae8ff; color: #a21caf; }
.type-vorspiel { background: var(--accent-soft); color: var(--amber-text); }
.type-unterricht { background: #e0f2fe; color: #0369a1; }
.type-ferien { background: var(--green-soft); color: #15803d; }
.type-sonstiges { background: #eef0f6; color: #4b5168; }

/* ---- Kalender (Monatsansicht) -------------------------------------- */
.view-toggle { display: inline-flex; background: #eef0f6; border-radius: 10px; padding: 3px; }
.vt-btn { border: none; background: none; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.vt-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-head .btn svg { width: 16px; height: 16px; }
.cal-title { font-size: 18px; font-weight: 700; min-width: 160px; text-align: center; }
.cal-card { padding: 0; overflow: hidden; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--primary-50); border-bottom: 1px solid var(--line); }
.cal-weekdays div { padding: 10px 6px; text-align: center; font-weight: 700; font-size: 12.5px; color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 98px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: #fafafc; }
.cal-today { background: var(--primary-50); }
.cal-daynum { font-size: 13px; font-weight: 700; color: #44485c; }
.cal-today .cal-daynum { color: var(--primary); display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--primary); color: #fff; border-radius: 50%; }
.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-event { border: none; text-align: left; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.cal-event:hover { filter: brightness(.95); }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 700px) {
  .cal-cell { min-height: 66px; padding: 3px; }
  .cal-event { font-size: 9px; padding: 2px 4px; }
  .cal-title { min-width: 110px; font-size: 16px; }
  .cal-weekdays div { font-size: 11px; padding: 8px 2px; }
}

.rsvp-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rsvp-btn { border: 1.5px solid var(--line); background: #fff; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #4b5168; transition: all .12s; }
.rsvp-btn:hover { border-color: var(--primary-600); }
.rsvp-btn.active-yes { background: var(--green-soft); border-color: var(--green); color: #15803d; }
.rsvp-btn.active-maybe { background: var(--accent-soft); border-color: var(--accent); color: var(--amber-text); }
.rsvp-btn.active-no { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.attendees { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---- Mitglieder ---------------------------------------------------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 10px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.filter-bar input { flex: 1; min-width: 180px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.member-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; position: relative; }
.member-card .avatar { margin: 0 auto 12px; }
.member-card .m-name { font-weight: 700; font-size: 16px; }
.member-card .m-inst { color: var(--muted); font-size: 13.5px; margin: 4px 0 10px; display: inline-flex; align-items: center; gap: 5px; }
.member-card .m-bio { font-size: 13px; color: #4b5168; line-height: 1.45; margin-top: 10px; }
.role-select { padding: 5px 9px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 12.5px; font-weight: 600; background: #fff; color: var(--text); cursor: pointer; }
.role-select:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.member-card .m-del { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s; }
.member-card:hover .m-del { opacity: 1; }

/* ---- Chat ---------------------------------------------------------- */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - 150px); min-height: 460px; }
.channel-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-y: auto; box-shadow: var(--shadow); }
.channel-btn { display: block; width: 100%; text-align: left; padding: 11px 13px; border-radius: var(--radius-sm); border: none; background: none; margin-bottom: 3px; transition: background .12s; }
.channel-btn:hover { background: #f3f3f9; }
.channel-btn.active { background: var(--primary-50); }
.channel-btn .ch-name { font-weight: 700; font-size: 14.5px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.channel-btn .ch-desc { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-btn.active .ch-name { color: var(--primary); }

.chat-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.chat-head { padding: 15px 20px; border-bottom: 1px solid var(--line); }
.chat-head h3 { margin: 0; font-size: 16px; }
.chat-head .ch-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; }
.msg .avatar { flex-shrink: 0; }
.msg-body { background: #f3f3f9; padding: 9px 13px; border-radius: 4px 14px 14px 14px; max-width: 78%; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { background: var(--primary-50); border-radius: 14px 4px 14px 14px; }
.msg .msg-name { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.msg .msg-text { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg .msg-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chat-input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 999px; }
.chat-input input:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.chat-input .btn { border-radius: 999px; padding: 0 18px; }

/* Geschlossene Gruppen */
.ch-name .hash { color: var(--muted); font-weight: 700; }
.ch-name svg { width: 14px; height: 14px; flex-shrink: 0; }
.ch-section { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin: 16px 8px 6px; display: flex; align-items: center; gap: 5px; }
.ch-section svg { width: 13px; height: 13px; }
.chat-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chat-head h3 { display: flex; align-items: center; gap: 6px; }
.chat-head h3 svg { width: 16px; height: 16px; }
.chat-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.mm-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.mm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; }
.mm-row > span { display: flex; align-items: center; gap: 7px; min-width: 0; }

/* ---- Profil -------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-head .avatar { box-shadow: var(--shadow); }
.profile-head .p-name { font-size: 24px; font-weight: 800; }
.profile-form { max-width: 520px; }

/* ---- Einstellungen ------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid .set-images { grid-column: 1 / -1; }
.color-input { width: 54px; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.hex-input { width: 120px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-family: ui-monospace, monospace; font-size: 14px; }
.hex-input:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.set-img-row { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-img-row:last-child { border-bottom: none; }
.set-img-thumb { width: 88px; height: 88px; border: 1.5px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; background: #fff; }
.set-img-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-img-empty { font-size: 11.5px; color: var(--muted); text-align: center; }
.file-btn { display: inline-flex; cursor: pointer; }

/* ---- Classrooms ---------------------------------------------------- */
.classroom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.classroom-card { display: flex; gap: 14px; text-align: left; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .08s; }
.classroom-card:hover { border-color: var(--primary-600); }
.classroom-card:active { transform: translateY(1px); }
.cc-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--primary-50); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.cc-body { min-width: 0; }
.cc-name { font-weight: 700; font-size: 16.5px; display: flex; align-items: center; gap: 6px; }
.cc-name svg { width: 13px; height: 13px; color: var(--muted); }
.cc-desc { color: var(--muted); font-size: 13.5px; margin: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { font-size: 12.5px; color: var(--primary); font-weight: 600; }

.back-btn { margin-bottom: 12px; }
.back-btn svg { width: 16px; height: 16px; }

.post-feed { display: flex; flex-direction: column; gap: 14px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s; }
.post-card:hover { border-color: var(--primary-100); }
.post-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-top h3 { margin: 0; font-size: 17px; }
.post-top h2 { flex: 1; }
.kind-badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.kind-question { background: #e0f2fe; color: #0369a1; }
.kind-material { background: var(--accent-soft); color: var(--amber-text); }
.post-body { color: #3a3d52; line-height: 1.55; white-space: pre-wrap; margin-top: 8px; }
.post-meta { color: var(--muted); font-size: 13px; margin-top: 12px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.att-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.att-video { width: 100%; max-width: 420px; border-radius: 12px; background: #000; max-height: 320px; }
.att-image { max-width: 240px; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); display: block; }
.att-audio { width: 100%; max-width: 360px; }
.att-file { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 600; background: #fff; transition: border-color .15s; }
.att-file:hover { border-color: var(--primary-600); }
.att-file svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.att-file .att-size { color: var(--muted); font-weight: 500; font-size: 12px; }

.reply-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.reply { display: flex; gap: 10px; }
.reply-body { background: #f3f3f9; border-radius: 4px 14px 14px 14px; padding: 9px 14px; flex: 1; min-width: 0; }
.reply-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.reply-text { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.reply-form { display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.reply-form input { flex: 1; padding: 11px 15px; border: 1.5px solid var(--line); border-radius: 999px; }
.reply-form input:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.reply-form .btn { border-radius: 999px; padding: 0 18px; }

.po-filelist { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.po-fileitem { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #3a3d52; }
.po-fileitem svg { width: 15px; height: 15px; color: var(--primary); }
.po-progress { margin-top: 10px; font-size: 13px; color: var(--primary); font-weight: 600; }

/* ---- Leerzustände / Hinweise --------------------------------------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { font-size: 46px; display: block; margin-bottom: 12px; opacity: .7; }
.muted { color: var(--muted); }

/* ---- Modal --------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,18,45,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; backdrop-filter: blur(2px); }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 18px 24px 24px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---- Toasts -------------------------------------------------------- */
#toast-container { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; animation: slideIn .25s ease; max-width: 320px; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Mobile Bottom-Nav --------------------------------------------- */
.bottom-nav { display: none; }

/* ====================================================================== */
/*  RESPONSIVE                                                            */
/* ====================================================================== */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .sidebar { display: none; }
  .topbar { display: flex; }
  .content { padding: 18px 16px 90px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .channel-list { display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
  .channel-list.hide-on-mobile { display: none; }
  .channel-btn { min-width: 150px; }
  .chat-main { height: calc(100vh - 230px); min-height: 380px; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 50; justify-content: space-around;
  }
  .bottom-nav button {
    flex: 1; border: none; background: none; padding: 6px 2px; display: flex; flex-direction: column;
    align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.active { color: var(--primary); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .member-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .page-head h1 { font-size: 22px; }
}
