/* ═══════════════════════════════════════════════════
   glulando Design System — app.css v2.3 MOBILE-FIRST
   Farben: Blau (#1E40AF) + Weiß + Dark Mode
   Font: Inter
   UPDATE 16.03.2026: Community Feed Mobile + Dark Mode Fix
   UPDATE 15.03.2026: Support + Integration Cards Mobile Fix
   UPDATE 06.03.2026: Immersive Mode Layout Fix
   UPDATE 04.03.2026: Sidebar Scrollbar Styling
   UPDATE 28.02.2026: Komplette Mobile-Optimierung
   ═══════════════════════════════════════════════════ */

:root {
    --primary: #1E40AF;
    --primary-light: #3B82F6;
    --primary-dark: #1E3A8A;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;
    --accent: #F59E0B;
    --accent-light: #FCD34D;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #06B6D4;

    --bg: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #1E293B;
    --bg-input: #F3F4F6;
    --border: #E5E7EB;
    --border-focus: #3B82F6;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-inverse: #FFFFFF;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --sidebar-w: 260px;
    --header-h: 64px;
    --transition: 200ms ease;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

body.dark {
    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-sidebar: #0F172A;
    --bg-input: #334155;
    --border: #475569;
    --text: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,.3);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; -webkit-appearance: none; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ─── Icons ──────────────────────────────────────── */
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; vertical-align: middle; width: 20px; height: 20px; }
.icon svg { width: 100%; height: 100%; display: block; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg .icon { width: 20px; height: 20px; }
.card .card-body .icon { width: 24px; height: 24px; }
.post-actions .icon { width: 14px; height: 14px; }
.topbar .icon { width: 20px; height: 20px; }
.menu-toggle .icon { width: 24px; height: 24px; }

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

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w); background: var(--bg-sidebar); color: #CBD5E1;
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
    height: 100vh; height: 100dvh; z-index: 50;
    transition: transform 280ms cubic-bezier(.4,0,.2,1); overscroll-behavior: contain;
}
.sidebar-logo {
    padding: 20px 24px; font-size: 22px; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08); display: flex;
    align-items: center; gap: 10px; height: var(--header-h); flex-shrink: 0;
}
.sidebar-logo span { color: var(--primary-light); }
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 0;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px; padding: 11px 24px;
    color: #94A3B8; font-size: 14px; font-weight: 500; transition: all var(--transition);
    text-decoration: none; border-left: 3px solid transparent; min-height: 44px;
}
.sidebar-nav a:hover { color: #E2E8F0; background: rgba(255,255,255,.04); }
.sidebar-nav a.active { color: #fff; background: rgba(59,130,246,.12); border-left-color: var(--primary-light); }
.sidebar-nav a .icon { width: 16px; height: 16px; opacity: .7; }
.sidebar-nav a.active .icon { opacity: 1; }
.sidebar-section {
    padding: 16px 24px 6px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: #475569;
    display: flex; align-items: center; gap: 6px;
}
.sidebar-section .icon { width: 12px; height: 12px; opacity: .6; }
.sidebar-footer {
    padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.06); font-size: 13px;
    flex-shrink: 0; padding-bottom: calc(16px + var(--safe-bottom));
}

/* ─── Sidebar Backdrop (Mobile) ──────────────────── */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 45; opacity: 0; transition: opacity 280ms ease;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sidebar-backdrop.visible { opacity: 1; }

/* ─── Main Content ───────────────────────────────── */
.main-content {
    flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; transition: margin-left var(--transition);
}

/* ─── Topbar ─────────────────────────────────────── */
.topbar {
    height: var(--header-h); background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 30; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar #page-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Page Content ───────────────────────────────── */
.page-content { flex: 1; padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ─── Menu Toggle ────────────────────────────────── */
.menu-toggle {
    display: none; background: none; border: none; color: var(--text);
    padding: 10px; min-width: 44px; min-height: 44px;
    align-items: center; justify-content: center; border-radius: var(--radius); margin: 0 -10px 0 -10px;
}
.menu-toggle:active { background: var(--bg-input); }

/* ─── Sidebar Close Button (Mobile) ──────────────── */
.sidebar-close {
    display: none; position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,.1); border: none; color: #94A3B8;
    width: 36px; height: 36px; border-radius: var(--radius);
    align-items: center; justify-content: center; font-size: 20px; z-index: 2;
}
.sidebar-close:active { background: rgba(255,255,255,.2); }

/* ═══════════════════════════════════════════════════
   IMMERSIVE MODE — Video/Webinar Player
   ═══════════════════════════════════════════════════ */
body.gl-immersive { overflow: hidden; height: 100dvh; }
body.gl-immersive .main-content {
    margin-left: 0 !important;
    height: 100dvh;
    overflow: hidden;
    min-height: 0;
}
body.gl-immersive .page-content {
    padding: 0 !important;
    max-width: none !important;
    height: 100dvh;
    overflow: hidden;
    margin: 0;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius); font-weight: 600;
    font-size: 14px; border: none; transition: all var(--transition);
    white-space: nowrap; text-decoration: none; min-height: 44px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-primary:active { transform: scale(.97); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius); min-height: 44px; min-width: 44px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-group, .flex.gap-2:has(.btn), .flex.gap-3:has(.btn) { flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border); }

/* ─── Integration Card Layout ────────────────────── */
.int-card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.int-card-info { flex: 1; min-width: 0; }
.int-card-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ─── Support Page Layouts ───────────────────────── */
.support-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.support-detail-layout { display: flex; gap: 16px; }
.support-detail-main { flex: 1; min-width: 0; }
.support-detail-sidebar { width: 280px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); }
.kpi-change { font-size: 13px; font-weight: 600; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text); font-size: 16px; transition: all var(--transition); min-height: 44px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(to right, var(--bg-card) 30%, transparent),
        linear-gradient(to left, var(--bg-card) 30%, transparent),
        linear-gradient(to right, rgba(0,0,0,.08), transparent 15px),
        linear-gradient(to left, rgba(0,0,0,.08), transparent 15px);
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 15px 100%, 15px 100%;
    background-attachment: local, local, scroll, scroll;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary);
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tbody tr:hover { background: var(--primary-50); }
body.dark tbody tr:hover { background: rgba(59,130,246,.06); }
.table-wrap table { min-width: 600px; }

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: var(--radius-full); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-info { background: #CFFAFE; color: #155E75; }
.badge-neutral { background: var(--bg-input); color: var(--text-secondary); }
body.dark .badge-success { background: rgba(16,185,129,.2); color: #34D399; }
body.dark .badge-warning { background: rgba(245,158,11,.2); color: #FCD34D; }
body.dark .badge-danger { background: rgba(239,68,68,.2); color: #FCA5A5; }
tr.upgrade-warn td { background: #FFFBEB; }
tr.upgrade-limit td { background: #FEF2F2; }
body.dark tr.upgrade-warn td { background: rgba(245,158,11,.07); }
body.dark tr.upgrade-limit td { background: rgba(239,68,68,.07); }

/* ═══════════════════════════════════════════════════
   CHAT
   ═══════════════════════════════════════════════════ */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 48px); height: calc(100dvh - var(--header-h) - 48px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.chat-bubble { max-width: 85%; padding: 12px 16px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.6; word-break: break-word; }
.chat-bubble.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.ai { background: var(--bg-card); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-bubble.ai .agent-name { font-size: 12px; font-weight: 600; color: var(--primary-light); margin-bottom: 4px; }
.chat-typing { padding: 8px 20px; font-size: 13px; color: var(--text-muted); font-style: italic; }
.chat-input-bar {
    display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border);
    background: var(--bg-card); padding-bottom: calc(16px + var(--safe-bottom)); flex-shrink: 0;
}
.chat-input-bar input { flex: 1; min-width: 0; }
.chat-input-bar .btn .icon { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════
   FEED
   ═══════════════════════════════════════════════════ */
.feed-post { margin-bottom: 16px; }
.feed-post .post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.feed-post .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--primary-100);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; color: var(--primary); font-size: 16px; flex-shrink: 0;
}
.feed-post .post-meta { font-size: 13px; color: var(--text-secondary); }
.feed-post .post-content { font-size: 15px; line-height: 1.7; margin-bottom: 12px; word-break: break-word; }
.feed-post .post-actions { display: flex; gap: 16px; }
.feed-post .post-actions button { display: flex; align-items: center; gap: 6px; font-size: 13px; min-height: 36px; }

/* ─── Community Feed: Reaction Buttons ───────────── */
.feed-post .react-btn {
    font-size: 15px !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    transition: all .15s !important;
    line-height: 1 !important;
}
body.dark .feed-post .react-btn {
    background: rgba(255,255,255,.08) !important;
    border-color: rgba(255,255,255,.12) !important;
    color: var(--text) !important;
}
body.dark .feed-post .react-btn[style*="rgba(59,130,246"] {
    background: rgba(59,130,246,.2) !important;
    border-color: var(--primary-light) !important;
}
/* ─── Community Feed: Kommentar-Input größer ─────── */
.feed-post .comments-section .form-input {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
}
body.dark .feed-post .comments-section .form-input {
    background: rgba(255,255,255,.06) !important;
    border-color: rgba(255,255,255,.15) !important;
    color: #E2E8F0 !important;
}
body.dark .feed-post .comments-section .form-input::placeholder {
    color: #94A3B8 !important;
}
/* ─── Dark Mode: Post-Trennlinien sichtbarer ─────── */
body.dark .feed-post .post-actions[style*="border-top"] {
    border-color: rgba(255,255,255,.12) !important;
}
body.dark .feed-post .comments-section {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 12px;
}
/* ─── Dark Mode: Card-Borders heller ─────────────── */
body.dark .card.feed-post {
    border-color: rgba(255,255,255,.12);
}
/* ─── Dark Mode: Text "Noch keine Kommentare" ────── */
body.dark .feed-post .text-muted {
    color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════ */
.tabs {
    display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary);
    border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer;
    transition: all var(--transition); background: none; border-top: none;
    border-left: none; border-right: none; white-space: nowrap; min-height: 44px; flex-shrink: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: fadeIn .15s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl); width: 100%; max-width: 540px;
    max-height: 90vh; max-height: 90dvh; overflow-y: auto; animation: slideUp .2s ease;
    -webkit-overflow-scrolling: touch;
}
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 12px;
    position: sticky; bottom: 0; background: var(--bg-card); flex-wrap: wrap;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ═══════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #2563EB 100%);
    padding: 24px; padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom));
}
.auth-card {
    background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    padding: 40px; width: 100%; max-width: 420px;
}
body.dark .auth-card { background: var(--bg-card); }
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; text-align: center; color: var(--text); }
.auth-card p { text-align: center; color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.auth-card .logo { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 24px; }
.auth-card .logo span { color: var(--primary); }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 13px; margin: 20px 0; }

/* ═══════════════════════════════════════════════════
   MISC COMPONENTS
   ═══════════════════════════════════════════════════ */
.notif-bell { position: relative; }
.notif-count {
    position: absolute; top: -4px; right: -4px; background: var(--danger);
    color: #fff; font-size: 10px; font-weight: 700; min-width: 18px;
    height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-secondary); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: .4; width: auto; height: auto; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto 20px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.pagination button { min-width: 36px; height: 36px; border-radius: var(--radius); font-size: 14px; }
.pagination button.active { background: var(--primary); color: #fff; border: none; }

/* ═══════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════ */
.spinner-sm { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   PIPELINE (CRM)
   ═══════════════════════════════════════════════════ */
.pipeline { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
.pipeline-col { min-width: 280px; flex: 1; background: var(--bg); border-radius: var(--radius-lg); padding: 12px; }
.pipeline-col h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; padding: 0 4px; }
.pipeline-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all var(--transition); }
.pipeline-card:hover { box-shadow: var(--shadow-md); }

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 48px); }
.toast {
    padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: slideIn .25s ease; min-width: 280px;
    display: flex; align-items: center; gap: 10px; word-break: break-word;
}
.toast-success { background: #065F46; color: #fff; }
.toast-error { background: #991B1B; color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══════════════════════════════════════════════════
   DARK MODE TOGGLE
   ═══════════════════════════════════════════════════ */
.dark-toggle {
    width: 44px; height: 24px; border-radius: 12px; background: var(--bg-input);
    border: 1px solid var(--border); position: relative; cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.dark-toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%; background: var(--primary); transition: transform var(--transition);
}
body.dark .dark-toggle::after { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════
   PAGE HELPERS
   ═══════════════════════════════════════════════════ */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header .page-title { margin: 0; }

/* ═══════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ═══════════════════════════════════════════════════
   GROUP COACHING STYLES
   ═══════════════════════════════════════════════════ */
.modal-backdrop { position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px; }
.modal-backdrop.hidden { display:none; }
.modal-content { background:var(--bg-card);border-radius:16px;width:100%;max-width:560px;max-height:90vh;overflow-y:auto;box-shadow:0 25px 50px rgba(0,0,0,0.25); }
body.dark .modal-content { background:#1E293B; }
.flex-row-reverse { flex-direction: row-reverse; }
.gc-room { display:flex;flex-direction:column;height:calc(100vh - 120px); }
.gc-room__header { display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border);flex-shrink:0; }
.gc-room__header-left { display:flex;align-items:center;gap:12px; }
.gc-room__title { display:flex;align-items:center;gap:8px; }
.gc-room__title h2 { margin:0;font-size:18px; }
.gc-room__body { display:flex;flex:1;overflow:hidden; }
.gc-room__chat { display:flex;flex-direction:column;flex:1;min-width:0; }
.gc-room__sidebar { width:240px;flex-shrink:0;border-left:1px solid var(--border);padding:16px;overflow-y:auto; }
.gc-room__sidebar h3 { margin:0 0 12px;font-size:14px; }
.gc-messages { flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px; }
.gc-messages__empty { text-align:center;padding:40px;color:var(--text-muted); }
.gc-room__input { padding:12px 16px;border-top:1px solid var(--border);flex-shrink:0; }
.gc-input__form { display:flex;gap:8px;align-items:flex-end; }
.gc-input__textarea { flex:1;resize:none;border:1px solid var(--border);border-radius:8px;padding:10px 12px;font-size:14px;font-family:inherit;background:var(--bg-card);color:inherit; }
body.dark .gc-input__textarea { background:#1E293B;border-color:#334155; }
.gc-input__send { height:42px;width:42px;display:flex;align-items:center;justify-content:center;font-size:18px; }
.gc-input__hint { font-size:12px;color:var(--text-muted);margin-top:8px; }
.gc-msg { display:flex;gap:8px;animation:gcFadeIn 0.2s ease; }
.gc-msg--system { justify-content:center;padding:4px 0; }
.gc-msg--system span { font-size:12px;color:var(--text-muted);font-style:italic; }
.gc-msg--ai .gc-msg__avatar { background:#059669; }
.gc-msg__body { max-width:75%;padding:10px 14px;border-radius:12px;background:var(--bg-input);border-bottom-left-radius:4px; }
body.dark .gc-msg__body { background:#1E293B; }
.gc-msg--own .gc-msg__body { background:var(--primary);color:#fff;border-radius:12px;border-bottom-right-radius:4px;margin-left:auto; }
.gc-msg--own { flex-direction:row-reverse; }
.gc-msg--ai .gc-msg__body { background:#ECFDF5;border-left:3px solid #059669; }
body.dark .gc-msg--ai .gc-msg__body { background:#064E3B; }
.gc-msg--pending { opacity:0.6; }
.gc-msg__name { font-size:12px;font-weight:600;margin-bottom:4px;color:var(--text-muted); }
.gc-msg--own .gc-msg__name { color:rgba(255,255,255,0.7); }
.gc-msg__text { font-size:14px;line-height:1.5; }
.gc-msg__meta { font-size:11px;color:var(--text-muted);margin-top:6px; }
.gc-msg__avatar { width:32px;height:32px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex-shrink:0; }
.gc-badge { display:inline-block;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:600; }
.gc-badge--live { background:#DC2626;color:#fff;animation:gcPulse 2s infinite; }
.gc-badge--mode { background:var(--bg-input);color:var(--text-muted); }
.gc-badge--voice { background:#7C3AED;color:#fff; }
.gc-participant { display:flex;align-items:center;gap:6px;padding:4px 0;font-size:13px; }
.gc-participant--me { font-weight:600; }
.gc-participant__status { font-size:10px; }
.gc-hand-queue { margin-top:16px;padding-top:12px;border-top:1px solid var(--border); }
.gc-hand-queue h4 { margin:0 0 8px;font-size:13px; }
.gc-hand-queue__empty { font-size:12px;color:var(--text-muted); }
.admin-gc__grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px; }
@keyframes gcFadeIn { from { opacity:0;transform:translateY(4px); } to { opacity:1;transform:none; } }
@keyframes gcPulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }

/* ═══════════════════════════════════════════════════
   RESPONSIVE: TABLET (≤1024px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .page-content { padding: 20px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE: MOBILE (≤768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; width: min(var(--sidebar-w), 85vw); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
    .sidebar-backdrop { display: block; }
    .sidebar-close { display: flex; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .topbar { padding: 0 16px; gap: 8px; }
    .topbar-right { gap: 8px; }
    .topbar #page-title { font-size: 15px; }
    #logout-btn span:last-child { display: none; }
    #logout-btn { padding: 10px; gap: 0; }
    .page-content { padding: 16px; }
    .page-title { font-size: 20px; margin-bottom: 16px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-card { padding: 14px; }
    .kpi-value { font-size: 22px; }
    .kpi-label { font-size: 12px; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .card-header { padding: 14px 16px; }
    .card-body { padding: 16px; }
    .card-footer { padding: 14px 16px; }
    .chat-container { height: calc(100dvh - var(--header-h) - 16px); }
    .chat-messages { padding: 12px; gap: 12px; }
    .chat-bubble { max-width: 90%; padding: 10px 14px; font-size: 14px; }
    .chat-input-bar { padding: 12px 16px; padding-bottom: calc(12px + var(--safe-bottom)); gap: 8px; }
    .feed-post .avatar { width: 36px; height: 36px; font-size: 14px; }
    .feed-post .post-content { font-size: 14px; }
    /* Community Feed: Emoji-Reaktionen kleiner auf Mobile */
    .feed-post .react-btn {
        font-size: 12px !important;
        padding: 3px 6px !important;
    }
    .feed-post .react-btn span {
        font-size: 10px !important;
    }
    .feed-post .reaction-wrap {
        gap: 2px !important;
    }
    /* Community Feed: Kommentarfeld größer auf Mobile */
    .feed-post .comments-section .form-input {
        min-height: 48px !important;
        font-size: 16px !important;
    }
    .pipeline { flex-direction: column; overflow-x: visible; }
    .pipeline-col { min-width: 0; }
    .modal-overlay { padding: 8px; align-items: flex-end; }
    .modal { max-width: 100%; max-height: 95dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: slideUpMobile .25s ease; }
    .modal-header { padding: 16px 20px; }
    .modal-body { padding: 20px; }
    .modal-footer { padding: 14px 20px; padding-bottom: calc(14px + var(--safe-bottom)); }
    @keyframes slideUpMobile { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .tabs { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
    .tab { padding: 10px 16px; font-size: 13px; }
    .toast-container { top: auto; bottom: calc(24px + var(--safe-bottom)); right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; width: 100%; animation: slideUpToast .25s ease; }
    @keyframes slideUpToast { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    .auth-page { padding: 16px; }
    .auth-card { padding: 28px 24px; }
    .auth-card h1 { font-size: 22px; }
    .auth-card .logo { font-size: 24px; }
    .empty-state { padding: 40px 16px; }
    .empty-state .icon { font-size: 40px; }
    .empty-state h3 { font-size: 16px; }
    .sidebar-footer .text-sm { font-size: 12px; }
    .sidebar-footer .avatar { width: 28px !important; height: 28px !important; }
    .flex.justify-between { flex-wrap: wrap; gap: 8px; }
    .mobile-only { display: block; }
    .desktop-only { display: none; }
    .gc-room__sidebar { display:none; }
    .gc-room__body { flex-direction:column; }
    .gc-msg__body { max-width:90%; }
    .admin-gc__grid { grid-template-columns:1fr; }
    /* Integration Cards */
    .int-card-row { flex-direction: column; align-items: stretch; }
    .int-card-actions { justify-content: flex-start; }
    /* Support Page */
    .support-filter-grid { grid-template-columns: 1fr 1fr; }
    .support-detail-layout { flex-direction: column; }
    .support-detail-sidebar { width: 100%; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE: SMALL MOBILE (≤480px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; gap: 8px; }
    .kpi-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; }
    .kpi-value { font-size: 20px; }
    .topbar { height: 56px; }
    .topbar #page-title { font-size: 14px; }
    .page-content .flex.justify-between > .btn, .page-content .flex.gap-2 > .btn { flex: 1; min-width: 0; font-size: 13px; padding: 8px 12px; }
    .sidebar { width: min(240px, 85vw); }
    .table-wrap table { min-width: 500px; }
    thead th, tbody td { padding: 10px 12px; font-size: 13px; }
    .support-filter-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   LANDSCAPE MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar-nav a { padding: 7px 24px; min-height: 36px; }
    .sidebar-section { padding: 10px 24px 4px; }
    .chat-container { height: calc(100dvh - 56px - 8px); }
    .modal-overlay { align-items: center; }
    .modal { max-height: 90dvh; border-radius: var(--radius-xl); }
}

/* ═══════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════ */
@media print {
    .sidebar, .topbar, .menu-toggle, .sidebar-backdrop, .toast-container { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0; max-width: 100%; }
}