/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ══════════════════════════════════════════════════
   THEME VARIABLES
   ══════════════════════════════════════════════════ */

/* ── Dark (default) ──────────────────────────── */
[data-theme="dark"] {
    --bg-primary:    #181a20;
    --bg-secondary:  #1e2028;
    --bg-card:       #242630;
    --bg-card-hover: #2a2d3a;
    --border-color:  #2e3040;
    --border-hover:  #3a3d50;
    --text-primary:  #e8e9ed;
    --text-secondary:#9a9caa;
    --text-muted:    #6b6d7b;
    --accent:        #5865f2;
    --accent-hover:  #4752c4;
    --accent-glow:   rgba(88, 101, 242, 0.15);
    --success:       #43b581;
    --danger:        #e74c3c;
    --danger-hover:  #c0392b;
    --card-shadow:   rgba(0, 0, 0, 0.4);
    --logo-invert:   0;
    --glow-a:        rgba(88, 101, 242, 0.06);
    --glow-b:        rgba(88, 101, 242, 0.04);
}

/* ── Light ───────────────────────────────────── */
[data-theme="light"] {
    --bg-primary:    #f4f5f7;
    --bg-secondary:  #ffffff;
    --bg-card:       #ffffff;
    --bg-card-hover: #f8f9fb;
    --border-color:  #e2e4e9;
    --border-hover:  #cdd0d8;
    --text-primary:  #1a1c23;
    --text-secondary:#5c5f6e;
    --text-muted:    #8b8e9b;
    --accent:        #5865f2;
    --accent-hover:  #4752c4;
    --accent-glow:   rgba(88, 101, 242, 0.10);
    --success:       #2d9f6f;
    --danger:        #e74c3c;
    --danger-hover:  #c0392b;
    --card-shadow:   rgba(0, 0, 0, 0.06);
    --logo-invert:   0;
    --glow-a:        rgba(88, 101, 242, 0.04);
    --glow-b:        rgba(88, 101, 242, 0.03);
}

/* ── Shared tokens ───────────────────────────── */
:root {
    --radius:     14px;
    --radius-sm:  10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Smooth theme switch on all elements ─────── */
html, body, .wrapper, .header, .app-card, .app-icon,
.search-box input, .filter-pill, .app-badge, .footer,
.theme-toggle-track {
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Background Texture ──────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, var(--glow-a) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--glow-b) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    transition: background 0.5s ease;
}

/* ── Layout ──────────────────────────────────── */
.wrapper {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* ══════════════════════════════════════════════════
   THEME TOGGLE SWITCH
   ══════════════════════════════════════════════════ */
/* ── Theme Toggle (3-Segment: Dark | System | Light) ── */
.theme-toggle-wrapper {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    animation: fadeDown 0.5s ease 0.2s both;
}

.tt-seg {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.tt-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.tt-seg button:hover { color: var(--text-primary); }

.tt-seg button.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(88, 101, 242, 0.3);
}

/* ── Header ──────────────────────────────────── */
.header {
    text-align: center;
    padding: 2.5rem 0 2rem;
    animation: fadeDown 0.5s ease both;
}

.header-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    margin-bottom: 1.25rem;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.header-logo:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Logo switching per theme */
[data-theme="dark"] .logo-dark  { display: inline-block; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="light"] .logo-dark  { display: none; }
[data-theme="light"] .logo-light { display: inline-block; }

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}

.header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 400px;
    margin: 0 auto;
}

/* ── Search & Filters ────────────────────────── */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    animation: fadeDown 0.5s ease 0.1s both;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.filter-pill {
    padding: 0.55rem 0.9rem;
    min-height: 36px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card);
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── App Grid ────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* ── App Card ────────────────────────────────── */
.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: var(--transition);
}

.app-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px -8px var(--card-shadow);
}

.app-card:hover::before { opacity: 1; }

.app-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.app-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-end;
}

.app-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.app-icon i {
    font-size: 1.15rem;
    color: var(--accent);
    line-height: 1;
}

.app-card:hover .app-icon {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.app-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

[data-theme="light"] .app-badge {
    background: var(--bg-primary);
}

.app-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.app-card-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.app-card-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.app-card-footer > span:first-child {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.app-card-footer svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    transition: transform var(--transition);
}

.app-card:hover .app-card-footer svg {
    transform: translateX(4px);
}

/* ── Status ──────────────────────────────────── */
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(67, 181, 129, 0.4);
}

.status-dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

.status-dot.checking {
    background: var(--text-muted);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

.app-card-footer .status {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* ── Empty State ─────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    grid-column: 1 / -1;
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state p { color: var(--text-muted); font-size: 0.95rem; }

.empty-state button {
    margin-top: 0.75rem;
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.empty-state button:hover { text-decoration: underline; }

/* ── Footer ──────────────────────────────────── */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.footer-links a i,
.footer-links a .fa-solid,
.footer-links a .fa-regular,
.footer-links a .fa-brands {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    display: inline-block;
    width: 1em;
    text-align: center;
}

.footer-links a:hover i,
.footer-links a:hover .fa-solid,
.footer-links a:hover .fa-regular,
.footer-links a:hover .fa-brands {
    color: var(--accent);
}

.footer p { font-size: 0.75rem; color: var(--text-muted); }

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover { color: var(--accent); }

/* ── Animations ──────────────────────────────── */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.app-card {
    animation: cardIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .wrapper { padding: 1.25rem 1rem 2rem; }
    .header  { padding: 1.5rem 0 1.25rem; }
    .header-logo { width: 72px; height: 72px; }
    .header h1 { font-size: 1.3rem; }
    .app-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .toolbar { gap: 0.5rem; }
    .search-box { max-width: 100%; }
    .theme-toggle-wrapper { top: 1rem; right: 1rem; }

    /* Footer-Links: besser gestapelt auf Mobile */
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }
    .footer-link-wrap {
        width: 100%;
        justify-content: center;
    }
}

/* ── User Bar ─────────────────────────────────────── */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px -2px var(--card-shadow);
}
.user-bar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}
.user-bar-info i {
    font-size: 1.1rem;
    color: var(--accent);
}
.user-bar-logout {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0.5rem 0.9rem;
    min-height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: var(--transition);
}
.user-bar-logout:hover {
    color: var(--error-color, #e74c3c);
    border-color: var(--error-color, #e74c3c);
    background: rgba(231, 76, 60, 0.08);
}

/* ── Footer Logout Link ───────────────────────────── */
.footer-logout-link {
    color: var(--error-color, #e74c3c) !important;
    opacity: 0.8;
}
.footer-logout-link:hover {
    opacity: 1;
}

/* ── Agenda Section (Mein Tag) ───────────────────────── */
.agenda-section {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}
.agenda-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.agenda-header h2 i {
    color: var(--accent);
    font-size: 1.1rem;
}
.agenda-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 10px);
    overflow: hidden;
}
.agenda-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.agenda-item:last-child {
    border-bottom: none;
}
.agenda-item:hover {
    background: var(--bg-card-hover);
}
.agenda-item-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.agenda-item.overdue .agenda-item-icon {
    color: var(--error-color, #e74c3c);
}
.agenda-item.due-today .agenda-item-icon {
    color: var(--warning-color, #f39c12);
}
.agenda-item-body {
    flex: 1;
    min-width: 0;
}
.agenda-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agenda-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.agenda-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.agenda-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.agenda-badge.overdue {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error-color, #e74c3c);
}
.agenda-badge.today {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning-color, #f39c12);
}
@media (max-width: 600px) {
    .agenda-section { padding: 0 0.5rem; }
    .agenda-item { padding: 0.5rem 0.75rem; }
}

/* ══════════════════════════════════════════════════════
   ADMIN: BAR, BUTTONS, MODALS
   ══════════════════════════════════════════════════════ */

/* ── Admin Bar ─────────────────────────────────── */
.admin-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    animation: fadeDown 0.4s ease both;
}

/* ── Admin Buttons ─────────────────────────────── */
.admin-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.admin-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.admin-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* ── Card Admin Overlay (Edit/Delete Buttons) ──── */
.app-card-admin {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}
.app-card:hover .app-card-admin { opacity: 1; }

.admin-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: all var(--transition);
}
.admin-icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.admin-icon-btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

/* ── Footer Admin Buttons (inline) ─────────────── */
.footer-link-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
}
.footer-admin-btns {
    display: inline-flex;
    gap: 0.15rem;
    margin-left: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.footer-link-wrap:hover .footer-admin-btns { opacity: 1; }

.admin-icon-btn-inline {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    transition: all var(--transition);
    padding: 0;
}
.admin-icon-btn-inline:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.admin-icon-btn-inline.admin-icon-btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ── Modal Overlay ─────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeDown 0.3s ease;
}
.modal h2 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Form Elements ─────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}
.modal input:focus,
.modal textarea:focus { border-color: var(--accent); }
.modal textarea { resize: vertical; min-height: 60px; }

/* ── Icon Preview ──────────────────────────────── */
.icon-preview {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}
.icon-preview i {
    font-size: 1.1rem;
    color: var(--accent);
}

/* ── Tag Input ─────────────────────────────────── */
.tag-group { position: relative; }

.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 42px;
    cursor: text;
}
.tag-input-wrapper:focus-within { border-color: var(--accent); }

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.tag-chip-remove {
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.7;
}
.tag-chip-remove:hover { opacity: 1; }

.tag-input-field {
    border: none !important;
    background: transparent !important;
    padding: 0.15rem 0 !important;
    min-width: 100px;
    flex: 1;
    font-size: 0.82rem;
    outline: none;
    color: var(--text-primary);
}

.tag-suggestions {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 0.25rem;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}
.tag-suggestions.active { display: block; }
.tag-suggestion-item {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-primary);
}
.tag-suggestion-item:hover,
.tag-suggestion-item.highlighted {
    background: var(--accent);
    color: #fff;
}

/* ══════════════════════════════════════════════════════
   COMING SOON CARDS
   ══════════════════════════════════════════════════════ */

/* ── Coming Soon (normale User — ausgegraut, nicht klickbar) */
.app-card-coming-soon {
    opacity: 0.5;
    filter: grayscale(40%);
    cursor: default;
    pointer-events: none;
}
.app-card-coming-soon:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-card);
    border-color: var(--border-color);
}
.app-card-coming-soon::before { opacity: 0 !important; }

/* ── Coming Soon (Admin — voll klickbar, dezenter Marker) */
.app-card-coming-soon-admin {
    border-style: dashed;
}
.app-card-coming-soon-admin .app-card-admin {
    pointer-events: all;
}

/* ── Coming Soon Badge ───────────────────────────── */
.coming-soon-badge {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Coming Soon Footer Text ─────────────────────── */
.coming-soon-footer-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
}

/* ══════════════════════════════════════════════════════
   TOGGLE SWITCH
   ══════════════════════════════════════════════════════ */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 12px;
    transition: background var(--transition);
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Admin Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }

    /* Admin-Buttons auf Karten: fließend statt absolute */
    .app-card-admin {
        opacity: 1;
        position: relative;
        top: auto;
        right: auto;
        align-self: flex-end;
        margin-top: -0.25rem;
        margin-bottom: -0.25rem;
    }

    /* Footer-Admin-Buttons immer sichtbar, etwas Abstand */
    .footer-admin-btns { opacity: 1; }

    /* User-Bar wrapping */
    .user-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Admin-Bar wrapping */
    .admin-bar {
        flex-wrap: wrap;
    }

    /* Modal kompakter auf Mobile */
    .modal {
        padding: 1.25rem;
        width: 95%;
    }

    /* Settings-Sections weniger Padding auf Mobile */
    .settings-section-body {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .settings-section.open .settings-section-body {
        padding: 0.5rem 0.5rem 1rem;
    }
    .settings-section-header {
        padding: 0.75rem 0.65rem;
    }
    .settings-section-title {
        font-size: 0.85rem;
        gap: 0.4rem;
    }
    .settings-section-status {
        gap: 0.35rem;
    }
    .settings-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    .settings-section-actions {
        flex-wrap: wrap;
    }
}

/* ══════════════════════════════════════════════════════
   SETTINGS / INTEGRATIONEN MODAL
   ══════════════════════════════════════════════════════ */
.settings-modal {
    max-width: 600px;
    overflow-x: hidden;
}

.settings-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 300;
}

.settings-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Section (aufklappbar) */
.settings-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 10px);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition);
}

.settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.settings-section-header:hover {
    background: var(--hover-bg, rgba(88, 101, 242, 0.04));
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.settings-section-title i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    color: var(--accent);
}

.settings-section-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.settings-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.settings-section.open .settings-chevron {
    transform: rotate(180deg);
}

.settings-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 500;
}

.settings-badge.active {
    background: rgba(67, 181, 129, 0.12);
    color: #43b581;
}

.settings-badge.inactive {
    background: var(--hover-bg, rgba(0,0,0,0.04));
    color: var(--text-muted);
}

/* Body (aufklappbar) */
.settings-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1rem;
}

.settings-section.open .settings-section-body {
    max-height: 1200px;
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--border-color);
}

.settings-section-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.admin-btn-danger {
    color: #e04040;
    border-color: rgba(224, 64, 64, 0.3);
}

.admin-btn-danger:hover {
    background: rgba(224, 64, 64, 0.08);
    border-color: rgba(224, 64, 64, 0.5);
}

/* ═══ Ankündigungen ═══ */
.announcements-section {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}
.announcements-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.announcements-header h2 i {
    color: var(--accent);
    font-size: 1.1rem;
}
.announcement-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 10px);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}
.announcement-card.priority-urgent {
    border-left: 3px solid #ef4444;
}
.announcement-card.priority-important {
    border-left: 3px solid #f59e0b;
}
.announcement-card.priority-normal {
    border-left: 3px solid var(--border-color);
}
.announcement-card .ann-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.announcement-card .ann-body {
    font-size: 0.85rem;
    color: var(--text-secondary, var(--text-primary));
    line-height: 1.55;
    margin-bottom: 6px;
}
.announcement-card .ann-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}
.announcement-card .ann-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
}
.announcement-card .ann-badge-urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.announcement-card .ann-badge-important {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
