:root {
    --bg: #0b1120;
    --bg-soft: rgba(15, 23, 42, 0.75);
    --card: rgba(30, 41, 59, 0.6);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #475569;
    --danger: #ef4444;
    --success-bg: rgba(6, 78, 59, 0.85);
    --success-text: #6ee7b7;
    --error-bg: rgba(127, 29, 29, 0.85);
    --error-text: #fca5a5;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    line-height: 1.5;
    background:
        radial-gradient(1200px 800px at 15% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
        radial-gradient(1000px 700px at 100% 0%, rgba(139, 92, 246, 0.15), transparent 55%),
        linear-gradient(180deg, #0b1120 0%, #0d1528 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Animierter Netzwerk-Hintergrund */
#bg-network {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(1000px 600px at 50% 0%, transparent, rgba(11, 17, 32, 0.55) 90%);
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* Icons */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ===================== Layout mit Seitenleiste ===================== */
.layout {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    align-self: stretch;
    width: 250px;
    flex-shrink: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 16px;
    background: rgba(13, 20, 38, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid var(--border);
}
.content-area {
    flex: 1;
    min-width: 0;
    position: relative;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; color: #60a5fa; filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6)); }
.brand-accent {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav-group {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 14px 12px 6px;
}
.sidenav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 0.95rem;
    transition: background .15s ease, color .15s ease;
}
.sidenav-link:hover { background: rgba(148, 163, 184, 0.12); color: #fff; text-decoration: none; }
.sidenav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.05));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--primary);
}
.sidenav-link .icon { color: inherit; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-user { font-size: 0.85rem; color: var(--muted); padding: 0 12px; }
.sidebar-user strong { color: var(--text); }

/* Mobile-Menue-Button (Hamburger) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(13, 20, 38, 0.9);
    cursor: pointer;
    padding: 12px;
    flex-direction: column;
    justify-content: space-between;
}
.menu-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 26px 70px;
}
.container-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    max-width: 460px;
}

/* Backdrop nur auf dem Handy sichtbar */
.sidebar-backdrop { display: none; }

@media (max-width: 860px) {
    .menu-toggle { display: flex; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 82%;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 45;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .content-area { width: 100%; }
    .container { padding-top: 70px; }

    /* Abdunkelung hinter der geoeffneten Seitenleiste */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 44;
        background: rgba(2, 6, 23, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    color: #fff;
    transition: background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); }
.btn-secondary:hover { background: #3d4b61; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--border); }

/* Auth-Karten */
.auth-card {
    max-width: 400px;
    margin: 64px auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.auth-card h1 { margin: 0 0 6px; }
.auth-card form { margin-top: 20px; }

label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--muted);
}
input[type=text],
input[type=email],
input[type=password],
input[type=file],
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(11, 17, 32, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); border-color: transparent; }

.auth-card .btn { width: 100%; margin-top: 6px; }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }

/* Dashboard */
.dash-head { margin-bottom: 16px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1rem; }
.breadcrumb .sep { color: var(--muted); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    flex: 1 1 320px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.inline-form input[type=text],
.inline-form input[type=file] { margin-top: 0; }

/* Datei-/Ordner-Raster */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}
.tile {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 10px;
    text-align: center;
    transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tile:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.35); }
.tile-link { display: block; color: var(--text); }
.tile-link:hover { text-decoration: none; }
.tile-icon { margin-bottom: 10px; color: #60a5fa; line-height: 0; }
.tile-icon .icon { width: 34px; height: 34px; }

/* Vorschau-Bereich in der Kachel */
.tile-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    margin-bottom: 10px;
    color: #60a5fa;
}
.tile-thumb {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(11, 17, 32, 0.6);
    display: block;
}
.play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    line-height: 0;
    pointer-events: none;
}
.play-badge .icon {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 999px;
    padding: 8px;
    width: 34px;
    height: 34px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.tile-name {
    font-size: 0.9rem;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tile-meta { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.tile-up { display: flex; flex-direction: column; justify-content: center; }

.tile-del {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity .15s ease;
}
.tile:hover .tile-del { opacity: 1; }
.tile-del:hover { transform: scale(1.15); }

.empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; }

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

/* Speicheranzeige */
.storage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.storage-icon { color: #60a5fa; line-height: 0; display: inline-flex; flex-shrink: 0; }
.storage-info { flex: 1; min-width: 0; }
.storage-text {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.88rem;
    margin-bottom: 6px;
}
.storage-track {
    height: 8px;
    background: rgba(11, 17, 32, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 999px;
    transition: width .3s ease;
}
.storage-fill.storage-full {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* Speicher-Spalte im Admin-Panel */
.storage-cell { min-width: 190px; }
.storage-cell-text { font-size: 0.82rem; white-space: nowrap; }
.storage-track.mini { height: 6px; margin: 5px 0; max-width: 170px; }
.storage-form {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}
.storage-form input[type=number] {
    width: 78px;
    margin-top: 0;
    padding: 5px 7px;
    font-size: 0.8rem;
}
.storage-form .unit { font-size: 0.78rem; color: var(--muted); }
.storage-form .btn-mini { background: var(--secondary); }
.storage-form .btn-mini:hover { filter: brightness(1.12); }

/* Tile-Aktionen (Umbenennen / Loeschen) */
.tile-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s ease;
}
.tile:hover .tile-actions { opacity: 1; }
.tile-actions form { display: inline; }
.tile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .7);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #cbd5e1;
    padding: 5px;
    line-height: 0;
}
.tile-btn:hover { transform: scale(1.12); color: #fff; }

.move-form { margin-top: 8px; }
.move-form select {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}
.hidden-form { display: none; }

/* Upload-Live-Vorschau (vor dem Absenden) */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 22px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.up-prev {
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.up-prev img,
.up-prev video {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(11, 17, 32, 0.6);
    display: block;
}
.up-prev-file {
    width: 120px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-size: 0.72rem;
    color: var(--muted);
    border-radius: 8px;
    border: 1px dashed var(--border);
    word-break: break-word;
    overflow: hidden;
}
.up-prev-name {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================== Admin-Panel ===================== */
.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.admin-card h2 { margin-top: 0; font-size: 1.1rem; }

.admin-quicklinks { margin-bottom: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.user-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.user-create-form input,
.user-create-form select {
    margin-top: 0;
    width: auto;
    flex: 1 1 160px;
}

.table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.row-banned { background: rgba(127, 29, 29, .25); }

.badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 6px;
    margin-left: 4px;
}

.role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}
.role-user      { background: #334155; color: #cbd5e1; }
.role-supporter { background: #0e7490; color: #cffafe; }
.role-moderator { background: #6d28d9; color: #ede9fe; }
.role-admin     { background: #b45309; color: #fef3c7; }

.status { font-size: 0.8rem; font-weight: 600; }
.status-active { color: var(--success-text); }
.status-banned { color: var(--error-text); }

.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin: 2px; vertical-align: middle; }
.role-form select {
    padding: 4px 6px;
    font-size: 0.78rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}

.btn-mini { padding: 5px 10px; font-size: 0.78rem; }
.btn-warn   { background: #d97706; }
.btn-warn:hover   { background: #b45309; }
.btn-ok     { background: #059669; }
.btn-ok:hover     { background: #047857; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.95rem;
}

/* ===================== Support / Tickets ===================== */
.glass-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.glass-card h2 { margin-top: 0; font-size: 1.15rem; }

.ticket-form label { color: var(--muted); }
.ticket-form .btn { margin-top: 8px; }

/* Ticket-Liste */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(11, 17, 32, 0.4);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: border-color .15s ease, transform .1s ease;
}
.ticket-row:hover { border-color: var(--primary); transform: translateX(2px); text-decoration: none; }
.ticket-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.ticket-subject { font-weight: 600; }
.ticket-row-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.82rem; }

/* Badges / Pills */
.badge-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.prio-niedrig  { background: rgba(51, 65, 85, 0.6);   color: #cbd5e1; }
.prio-mittel   { background: rgba(37, 99, 235, 0.25); color: #93c5fd; border-color: rgba(37,99,235,0.4); }
.prio-hoch     { background: rgba(217, 119, 6, 0.25); color: #fbbf24; border-color: rgba(217,119,6,0.4); }
.prio-dringend { background: rgba(239, 68, 68, 0.25); color: #fca5a5; border-color: rgba(239,68,68,0.5); }

.tstatus-offen       { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
.tstatus-beantwortet { background: rgba(5, 150, 105, 0.22);  color: #6ee7b7; }
.tstatus-geschlossen { background: rgba(100, 116, 139, 0.25); color: #cbd5e1; }

/* Filter-Chips */
.ticket-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(11, 17, 32, 0.4);
    color: var(--muted);
    font-size: 0.85rem;
}
.filter-chip:hover { text-decoration: none; border-color: var(--primary); color: var(--text); }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Ticket-Header Meta */
.ticket-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Team-Aktionsleiste */
.ticket-admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-admin-bar form { display: inline; margin: 0; }

/* Nachrichten-Thread */
.ticket-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.msg {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    max-width: 85%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.msg-user  { background: rgba(30, 41, 59, 0.55); align-self: flex-start; border-top-left-radius: 4px; }
.msg-staff {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.4);
    align-self: flex-end;
    border-top-right-radius: 4px;
}
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin-bottom: 8px; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-attachments { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.att-thumb img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    transition: transform .15s ease;
}
.att-thumb:hover img { transform: scale(1.04); }

@media (max-width: 640px) {
    .msg { max-width: 100%; }

    /* Allgemein */
    .container { padding: 66px 14px 60px; }
    .dash-head h1 { font-size: 1.35rem; }
    .glass-card, .admin-card { padding: 16px; border-radius: 12px; }

    /* Toolbar: Formulare untereinander, volle Breite */
    .toolbar { flex-direction: column; gap: 10px; }
    .inline-form { flex: 1 1 auto; width: 100%; flex-wrap: wrap; }
    .inline-form .btn { width: 100%; justify-content: center; }
    .inline-form input[type=text],
    .inline-form input[type=file] { flex: 1 1 100%; }

    /* Datei-/Ordner-Raster kompakter */
    .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
    .tile { padding: 14px 8px; }
    .tile-preview, .tile-thumb { height: 78px; }
    .tile-name { font-size: 0.82rem; }
    /* Aktionen auf dem Handy immer sichtbar (kein Hover) */
    .tile-actions { opacity: 1; }

    /* Speicheranzeige */
    .storage-text { font-size: 0.8rem; }

    /* Ticket-Listen: Meta unter den Titel */
    .ticket-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
    .ticket-row-meta { font-size: 0.78rem; }
    .ticket-filters { gap: 6px; }
    .filter-chip { padding: 6px 12px; font-size: 0.82rem; }

    /* Buttons etwas groesser fuer Finger */
    .btn { padding: 12px 16px; }
    .btn-mini { padding: 7px 12px; }

    /* Admin-Tabelle als scrollbare Karte */
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 8px 10px; }
    .user-create-form input,
    .user-create-form select,
    .user-create-form .btn { flex: 1 1 100%; width: 100%; }

    /* Upload-Vorschau */
    .up-prev, .up-prev img, .up-prev video, .up-prev-file { width: 96px; }
    .up-prev img, .up-prev video, .up-prev-file { height: 72px; }

    /* SweetAlert2 nicht zu breit */
    .swal2-popup { width: 92% !important; }
}

@media (max-width: 380px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
    .brand { font-size: 1.05rem; }
}

/* ===================== SweetAlert2 Dark-Theme ===================== */
.swal2-popup {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    background: #0f172a !important;
    color: var(--text) !important;
}
.swal2-title { color: #f1f5f9 !important; font-weight: 700; }
.swal2-html-container { color: #cbd5e1 !important; }

.swal2-input,
.swal2-textarea,
.swal2-select {
    background: rgba(11, 17, 32, 0.85) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    caret-color: var(--text);
}
.swal2-input::placeholder,
.swal2-textarea::placeholder { color: var(--muted); }
.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
    outline: none;
}
.swal2-validation-message {
    background: rgba(127, 29, 29, 0.4) !important;
    color: #fca5a5 !important;
    border-radius: 8px;
}

/* Buttons */
.swal2-actions { gap: 10px; }
.swal2-styled {
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    box-shadow: none !important;
    transition: filter .15s ease;
}
.swal2-styled:focus { box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--primary) !important; }
.swal2-styled.swal2-confirm:hover { filter: brightness(1.1); }
.swal2-styled.swal2-cancel { background: var(--secondary) !important; }
.swal2-styled.swal2-cancel:hover { filter: brightness(1.1); }
.swal2-styled.swal2-deny { background: var(--danger) !important; }

/* Toasts */
.swal2-toast {
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}
.swal2-toast .swal2-title { color: var(--text) !important; }

/* Backdrop etwas weicher */
.swal2-container.swal2-backdrop-show { background: rgba(2, 6, 23, 0.6); }
