﻿/* --- VERBESSERTES ADMIN PANEL (UX & DESIGN) --- */
/* --- MODERNES ADMIN PRODUKT MANAGEMENT --- */
#admin-product-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Breitere Karten */
    gap: 20px;
    margin-top: 25px;
}

.admin-prod-card {
    background: rgba(20, 20, 20, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-prod-card:hover {
    border-color: var(--gold-main) !important;
    background: rgba(30, 30, 30, 0.8) !important;
    transform: translateY(-3px);
}

.admin-prod-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.admin-prod-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.admin-prod-info {
    flex: 1;
    overflow: hidden;
}

.admin-prod-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.admin-prod-meta {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    gap: 8px;
}

.admin-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

.admin-stock-indicator {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.stock-low { background: rgba(255, 0, 85, 0.15); color: var(--rarity-secret); }
.stock-ok { background: rgba(46, 204, 113, 0.15); color: var(--accent-green); }

.admin-quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-btn-icon {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.admin-btn-icon:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.admin-btn-delete-icon:hover {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--rarity-secret);
    color: var(--rarity-secret);
}
/* --- NEUE ADMIN PANEL VERBESSERUNGEN --- */
.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.admin-btn-edit {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold-main);
    color: var(--gold-main);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    flex: 1; /* Nimmt den restlichen Platz ein */
    transition: 0.3s;
}

.admin-btn-edit:hover {
    background: var(--gold-main);
    color: #000;
}

.admin-btn-delete {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--rarity-secret);
    color: var(--rarity-secret);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.admin-btn-delete:hover {
    background: var(--rarity-secret);
    color: #fff;
}

/* Admin action buttons in user table */
.adm-action-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    width: 100%;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}
.adm-action-btn:hover { background: rgba(255,255,255,0.12); }
.adm-btn-purple { background: rgba(155,89,182,0.1); border-color: rgba(155,89,182,0.4); color: #c39bd3; }
.adm-btn-purple:hover { background: rgba(155,89,182,0.25); }
.adm-btn-orange { background: rgba(255,140,0,0.1); border-color: rgba(255,140,0,0.35); color: #ff8c00; }
.adm-btn-orange:hover { background: rgba(255,140,0,0.22); }
.adm-btn-green { background: rgba(46,204,113,0.1); border-color: rgba(46,204,113,0.35); color: var(--accent-green); }
.adm-btn-green:hover { background: rgba(46,204,113,0.22); }
.adm-btn-red { background: rgba(255,45,85,0.1); border-color: rgba(255,45,85,0.35); color: #ff2d55; }
.adm-btn-red:hover { background: rgba(255,45,85,0.25); }

/* Tab-Inhalte Animation */
#admin-tab-products, #admin-tab-chats, #admin-tab-config {
    animation: fadeInDown 0.4s ease;
}
/* Zusätzliches Design für den Admin Editor */
#product-modal .auth-input {
    margin-bottom: 0; /* Verhindert doppelte Abstände im Grid */
}

#product-modal select.auth-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    appearance: none;
}
/* --- ADMIN CONFIG --- */

/* Schnellzugriff-Leiste */
.cfg-quick-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.cfg-quick-card {
    background: rgba(12, 14, 18, 0.9);
    border: 1px solid rgba(255,255,255,0.07);
    border-top: 3px solid var(--qa-color, #555);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.2s;
}
.cfg-quick-card:hover {
    background: rgba(20, 22, 28, 0.95);
}

.cfg-qa-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfg-qa-emoji {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px var(--qa-color, #888));
}

.cfg-qa-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #e0e0e0;
    letter-spacing: 0.5px;
}

.cfg-qa-sub {
    font-size: 0.68rem;
    color: #555;
    margin-top: 2px;
}

.cfg-qa-btn {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #ccc;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.cfg-qa-btn:hover {
    background: var(--qa-color, rgba(255,255,255,0.15));
    color: #000;
    border-color: transparent;
}

/* Config Grid */
.admin-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.config-card {
    background: rgba(10, 12, 16, 0.85) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 16px !important;
    padding: 22px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}
.config-card:hover {
    background: rgba(16, 18, 24, 0.95) !important;
}

.config-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--gold-main);
}

.input-stack {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-stack label {
    font-size: 0.7rem;
    color: #555;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.full-width-card { grid-column: 1 / -1; }

/* Ad Slots */
.cfg-ad-slot {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cfg-ad-slot-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* Save Button */
.save-all-btn {
    background: linear-gradient(135deg, #00c8ff, #0064cc) !important;
    color: #fff !important;
    padding: 18px !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    border-radius: 14px !important;
    letter-spacing: 2px !important;
    box-shadow: 0 8px 30px rgba(0, 150, 255, 0.25) !important;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}
.save-all-btn:hover { opacity: 0.9; }

@media (max-width: 1000px) {
    .cfg-quick-row { grid-template-columns: repeat(2, 1fr); }
    .admin-config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .cfg-quick-row { grid-template-columns: 1fr 1fr; }
}
/* --- GOLDEN GLOW LUCKY WHEEL BUTTON --- */
.wheel-trigger-btn {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 85px;
    height: 85px;
    /* Der Button selbst wird jetzt golden */
    background: var(--gold-gradient);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
    /* Ein dunkler Rand macht das Gold edler */
    border: 3px solid #000;
    /* Starker goldener Glow nach außen */
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4), 
                inset 0 0 20px rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatAnim 3s ease-in-out infinite;
}

/* Der zusätzliche "Glanz" Effekt beim Hover */
.wheel-trigger-btn:hover {
    transform: scale(1.15) rotate(8deg);
    border-color: #fff;
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.6), 
                inset 0 0 30px rgba(255, 255, 255, 0.8);
}

.wheel-icon-inner {
    width: 75%;
    height: 75%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    transition: transform 0.6s cubic-bezier(0.5, 0, 0.5, 1);
    position: relative;
    overflow: hidden; /* Wichtig für den Glanzstreifen */
    border-radius: 15px;
}

/* Der animierte Licht-Streifen */
.wheel-icon-inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: buttonShine 4s infinite ease-in-out;
}

@keyframes buttonShine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.wheel-trigger-btn:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: #fff;
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.wheel-trigger-btn:hover .wheel-icon-inner {
    transform: rotate(360deg);
}

/* Edle Sprechblase */
.wheel-tooltip {
    position: absolute;
    bottom: 95px;
    left: -10px;
    background: var(--gold-gradient);
    color: #000;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: none;
    border: 2px solid #000;
    animation: tooltipEntrance 0.5s ease-out both, tooltipBounce 4s infinite 0.5s;
}

.wheel-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 35px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #000;
}

.wheel-tooltip span {
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    opacity: 0.8;
}

@keyframes tooltipEntrance {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .wheel-trigger-btn { bottom: 90px; left: 15px; width: 65px; height: 65px; border-radius: 18px; }
    .wheel-icon-inner { width: 65%; height: 65%; }
    .wheel-tooltip { bottom: 80px; left: -5px; font-size: 0.75rem; }
}

@media (max-width: 768px) {
    .wheel-trigger-btn { bottom: 90px; left: 20px; width: 60px; height: 60px; }
    .wheel-icon-inner { font-size: 2rem; }
    .wheel-tooltip { left: 0; font-size: 0.7rem; padding: 8px 12px; }
}

.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 20px auto;
}

#lucky-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #1a1a1a; /* Massiver dunkler Rahmen */
    box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 20px rgba(255, 215, 0, 0.2);
    transition: transform 5s cubic-bezier(0.15, 0, 0.15, 1);
}

/* Der goldene Stopper-Pfeil oben */
.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px; 
    height: 40px;
    background: var(--gold-gradient);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 100;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    border: 2px solid rgba(0,0,0,0.2);
}

#wheel-status {
    font-size: 1.1rem;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    color: #fff;
    margin-top: 20px;
    font-weight: 600;
    border: 1px solid rgba(255,215,0,0.1);
}

/* Modal Anpassungen für das Rad */
#wheel-modal .modal-box {
    background: radial-gradient(circle at center, #151515 0%, #050505 100%);
    border: 2px solid var(--gold-main);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.15);
}

/* Neuer mega geiler Spin Button */
.wheel-spin-btn-mega {
    width: 100%;
    margin-top: 20px;
    padding: 18px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #000;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.wheel-spin-btn-mega:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.5);
    color: #fff;
}

.wheel-spin-btn-mega:disabled {
    background: #222;
    color: #555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.wheel-spin-btn-mega::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    animation: shine infinite 3s;
    z-index: 1;
}

/* --- MOBILE WHEEL & CHAT COMPATIBILITY FIX --- */
@media (max-width: 768px) {
    /* Der Button wandert etwas zur Seite, damit er beim Tippen nicht stört */
    .wheel-trigger-btn { 
        bottom: 95px; 
        left: 10px; 
        width: 50px; 
        height: 50px; 
        z-index: 998; /* Ein Layer unter dem Chat-Modal */
    }

    /* Wenn das Modal offen ist, erzwingen wir eine Max-Height, damit die Tastatur Platz hat */
    #wheel-modal .modal-box {
        width: 92%;
        padding: 15px;
        max-height: 80vh; 
        overflow-y: auto;
        top: -20px; /* Leicht nach oben verschoben */
    }

    .wheel-container {
        width: 220px; /* Noch kleiner für Mobile */
        height: 220px;
        margin: 5px auto;
    }

    /* Tooltip Fix: Verhindert Überlappung mit anderen Elementen */
    .wheel-tooltip {
        bottom: 65px;
        left: 0;
        font-size: 0.65rem;
        padding: 6px 10px;
        min-width: 140px;
    }

    /* Verstecke das Rad komplett, wenn die Tastatur/Chat aktiv ist (Optional) */
    .mobile-chat-active .wheel-trigger-btn {
        display: none !important;
    }
}

/* ══════════════════════════════════════
   ADMIN SHELL — two-column layout
   ══════════════════════════════════════ */
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    height: 100%;
    background: #060a18;
    overflow: hidden;
}

/* ── Sidebar ── */
.admin-sidenav {
    background: #040812;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
}
.admin-sidenav::-webkit-scrollbar { display: none; }

.admin-sidenav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.admin-sidenav-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(255,140,0,0.08));
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 11px;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(255,215,0,0.08);
}
.admin-sidenav-title {
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.2;
}
.admin-sidenav-sub {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* Nav items */
.admin-sidenav-items {
    padding: 14px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.42);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.admin-nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.82);
}
.admin-nav-active {
    background: rgba(255,215,0,0.09) !important;
    color: var(--gold-main) !important;
    border-color: rgba(255,215,0,0.2) !important;
    font-weight: 700 !important;
    box-shadow: inset 3px 0 0 var(--gold-main);
}
.admin-nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 2;
    opacity: 0.65;
    transition: opacity 0.15s;
}
.admin-nav-item:hover .admin-nav-icon { opacity: 1; }
.admin-nav-active .admin-nav-icon { opacity: 1; }
.admin-nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    animation: pulseBadge 2s ease infinite;
}
@keyframes pulseBadge {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
.admin-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 6px;
}

/* Compact stats in sidebar footer */
.admin-sidenav-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.asn-stat {
    padding: 14px 8px;
    text-align: center;
    background: #040812;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    line-height: 1.7;
    letter-spacing: 0.3px;
}
.asn-stat span { font-size: 1.2rem; font-weight: 900; display: block; line-height: 1.2; }

/* ── Main content ── */
.admin-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #060a18;
}

/* Mobile stats bar (hidden on desktop) */
.admin-mobile-stats { display: none; }
.admin-mstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-align: center;
    font-size: 0.58rem;
    color: rgba(255,255,255,0.38);
    white-space: nowrap;
    padding: 8px 14px;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.admin-mstat:last-child { border-right: none; }
.admin-mstat span { font-size: 1rem; font-weight: 900; line-height: 1.2; }

/* Tab content: scrollable, padded */
.admin-main > [id^="admin-tab-"]:not(#admin-tab-chats) {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.admin-main > #admin-tab-chats {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    align-items: stretch;
}

/* ══════════════════════════════════════
   ADMIN MOBILE TOP BAR
══════════════════════════════════════ */
.admin-mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #040812;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}
.admin-hamburger {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.admin-hamburger:hover { background: rgba(255,255,255,0.12); }
.admin-mobile-tab-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}
.admin-mobile-back {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    color: var(--gold-main);
    padding: 7px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}
.admin-mobile-back:hover { background: rgba(255,215,0,0.2); }

/* Drawer overlay backdrop */
.admin-drawer-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 399;
}
.admin-drawer-overlay.admin-overlay-open { display: block; }

/* Sidenav close button (shown on mobile inside drawer) */
.admin-sidenav-close {
    display: none;
    background: none; border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.3rem; cursor: pointer;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    border-radius: 6px;
    transition: 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}
.admin-sidenav-close:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ══════════════════════════════════════
   MOBILE ADMIN (≤900px) — DRAWER PATTERN
══════════════════════════════════════ */
@media (max-width: 900px) {
    /* Shell becomes a simple flex column */
    .admin-shell {
        display: flex !important;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    /* Sidenav: fixed drawer sliding from left */
    .admin-sidenav {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        z-index: 400;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
        overflow-y: auto;
        border-right: 1px solid rgba(255,255,255,0.1);
        box-shadow: none;
    }
    .admin-sidenav.admin-nav-open {
        transform: translateX(0);
        box-shadow: 6px 0 40px rgba(0,0,0,0.9);
    }
    .admin-sidenav-close { display: flex; }
    .admin-sidenav-stats { display: none; }

    /* Mobile header bar */
    .admin-mobile-header { display: flex; }

    /* Main: scrollable, full width */
    .admin-main {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    /* Mobile stats strip */
    .admin-mobile-stats {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        background: rgba(6,10,24,0.95);
        border-bottom: 1px solid rgba(255,255,255,0.06);
        flex-shrink: 0;
    }
    .admin-mobile-stats::-webkit-scrollbar { display: none; }

    /* Tab content padding */
    .admin-main > [id^="admin-tab-"]:not(#admin-tab-chats) {
        padding: 18px 14px 100px;
        flex: 1;
        overflow-y: visible;
    }
    .admin-main > #admin-tab-chats {
        flex: 1;
        min-height: 70vh;
    }

    /* Users tab: single column on mobile */
    #admin-tab-users > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }

    /* Tables: horizontal scroll on mobile */
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin user table: card layout */
    .admin-user-table thead { display: none; }
    .admin-user-table tbody { display: block; }
    .admin-user-table tr {
        display: block;
        background: rgba(255,255,255,0.02);
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 14px;
    }
    .admin-user-table td {
        display: block;
        border: none;
        padding: 4px 0;
        font-size: 0.82rem;
    }
    .admin-user-table td:not(:last-child) {
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        margin-bottom: 6px;
    }
    /* Mobile data labels */
    .admin-user-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.55rem;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #555;
        margin-bottom: 4px;
    }
    .admin-user-table td[data-label="Nutzer"]::before { color: var(--gold-main); }
    .admin-user-table td > div[style*="flex-direction:column"] {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .adm-action-btn { min-height: 38px !important; font-size: 0.75rem !important; }

    /* Credits table: stay as real table with horizontal scroll */
    .credits-table-styled thead { display: table-header-group; }
    .credits-table-styled tbody { display: table-row-group; }
    .credits-table-styled tr { display: table-row; background: transparent; border: none; border-radius: 0; margin: 0; padding: 0; }
    .credits-table-styled td { display: table-cell; padding: 10px 12px; }

    /* Proofs grid: 2 columns */
    #admin-pending-vouches, #admin-approved-vouches {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    /* Proofs: 1 column on tiny phones */
    #admin-pending-vouches, #admin-approved-vouches {
        grid-template-columns: 1fr !important;
    }
    .admin-main > [id^="admin-tab-"]:not(#admin-tab-chats) {
        padding: 14px 10px 100px;
    }
}

/* ── Admin content-box override inside shell ── */
.admin-main .content-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 22px;
    margin: 0;
    max-width: 100%;
}

/* Admin section sub-heading (h3 within tabs) */
.admin-main h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Refresh buttons across tabs: consistent style */
.admin-refresh-btn {
    background: rgba(0,200,255,0.08);
    border: 1px solid rgba(0,200,255,0.25);
    color: #00c8ff;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.admin-refresh-btn:hover { background: rgba(0,200,255,0.16); }

/* --- ADMIN STATS GRID --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}
@media (max-width: 1200px) {
    .admin-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
}
@media (max-width: 400px) {
    .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* --- ADMIN STAT CARDS --- */
.admin-stat-card {
    padding: 18px 14px;
    margin: 0;
    text-align: center;
    background: linear-gradient(145deg, rgba(var(--stat-color), 0.08), rgba(10,10,10,0.85));
    border: 1px solid rgba(var(--stat-color), 0.22);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), box-shadow 0.28s ease;
    cursor: default;
}
.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
.admin-stat-label {
    font-size: 0.68rem;
    color: #ccc;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-stat-value {
    font-size: 1.7rem;
    font-weight: 900;
    margin-top: 8px;
    text-shadow: 0 0 15px rgba(var(--stat-color), 0.35);
}

/* --- SIDEBAR COMPONENTS --- */
.ad-sidebar-premium {
    display: block;
    position: sticky;
    top: 140px;
    padding-left: 20px;
    border-left: 1px solid rgba(0, 255, 255, 0.1);
    min-height: 200px;
}

.sidebar-brand-box {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 20px 16px;
    margin-bottom: 20px;
    background: linear-gradient(145deg, rgba(255,215,0,0.06), rgba(10,10,10,0.9));
    border: 1px solid rgba(255,215,0,0.18);
    border-radius: 18px;
}
.sidebar-brand-glow {
    position: absolute;
    top: -30px; left: 50%;
    transform: translateX(-50%);
    width: 120px; height: 60px;
    background: radial-gradient(ellipse, rgba(255,215,0,0.25), transparent 70%);
    pointer-events: none;
}

.sidebar-vote-box {
    padding: 18px;
    margin-bottom: 20px;
    background: rgba(10,10,10,0.8);
    border: 1px solid rgba(255,215,0,0.15);
    border-radius: 16px;
}

.ad-slot-wrapper {
    background: rgba(10,10,10,0.6);
    border: 1px solid rgba(0,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.ad-slot-wrapper:hover {
    border-color: rgba(255,215,0,0.35);
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
}

.sidebar-discord-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, rgba(114,137,218,0.12), rgba(10,10,10,0.85));
    border: 1px solid rgba(114,137,218,0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
}
.sidebar-discord-box:hover {
    border-color: rgba(114,137,218,0.5);
    transform: translateY(-2px);
}

.ad-label {
    font-size: 0.68rem;
    color: var(--gold-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    text-align: center;
    padding: 8px 12px 7px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    background: rgba(255,215,0,0.04);
}

.ad-frame {
    border-radius: 0;
    overflow: hidden;
    background: #000;
    transition: 0.3s ease;
}

.ad-frame img {
    width: 100%;
    display: block;
    height: auto;
}

.ad-frame:hover {
    opacity: 0.9;
}

/* --- GLÜCKSRAD TRIGGER FIX --- */
#wheel-trigger {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- MOBILE ANPASSUNG (REPARATUR) --- */
@media (max-width: 1000px) {
    .shop-main-layout {
        grid-template-columns: 1fr; /* Sidebar nach unten verschieben */
    }
    
    .ad-sidebar-premium {
        position: static;
        border-left: none;
        border-top: 1px solid rgba(0, 255, 255, 0.1);
        padding: 30px 0;
        margin-top: 40px;
    }

    .ad-frame {
        max-width: 400px;
        margin: 0 auto 30px auto;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    .admin-stat-card {
        border-radius: 12px;
    }
    .admin-stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    /* Admin stat cards: 2 per row on small screens */
    #admin-view > div:nth-child(2) {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- ADMIN USER TABLE DESIGN --- */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: rgba(10, 10, 10, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #ccc;
    text-align: left;
}

.admin-user-table th {
    background: rgba(255, 215, 0, 0.05);
    color: var(--gold-main);
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.admin-user-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    vertical-align: middle;
}

/* Zebra-Look */
.admin-user-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.admin-user-table tr:hover {
    background: rgba(255, 215, 0, 0.03);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-online { background: rgba(46, 204, 113, 0.1); color: #2ecc71; }
.status-offline { background: rgba(155, 155, 155, 0.1); color: #888; }

.role-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}
.role-admin { background: var(--gold-main); color: #000; }
.role-user { border: 1px solid #444; color: #aaa; }
/* --- ADMIN USER TABLE DESIGN --- */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: rgba(10, 10, 10, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 15px;
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #ccc;
    text-align: left;
}

.admin-user-table th {
    background: rgba(255, 215, 0, 0.05);
    color: var(--gold-main);
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.admin-user-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    vertical-align: middle;
}

.admin-user-table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.admin-user-table tr:hover { background: rgba(255, 215, 0, 0.03); }

.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    display: inline-block;
}
.role-admin { background: var(--gold-main); color: #000; }
.role-user { border: 1px solid #444; color: #aaa; }
/* --- REFERRAL SYSTEM STYLES --- */
.referral-box-premium {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.05) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 25px;
}

.ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--gold-main);
    text-transform: uppercase;
}

.ref-count-badge {
    background: #000;
    color: var(--accent-green);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    border: 1px solid var(--accent-green);
}

.ref-text {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 15px;
}

.ref-link-wrapper {
    display: flex;
    gap: 10px;
}

.ref-link-wrapper input {
    flex: 1;
    background: rgba(0,0,0,0.5) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: var(--gold-main) !important;
    font-size: 0.75rem !important;
    padding: 10px !important;
    border-radius: 8px !important;
}

.ref-link-wrapper button {
    background: var(--gold-gradient);
    border: none;
    color: #000;
    padding: 0 15px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.3s;
}

.ref-link-wrapper button:active { transform: scale(0.95); }
/* --- ADMIN LEADERBOARD ANIMATION --- */
#admin-partner-leaderboard div {
    animation: fadeInDown 0.3s ease forwards;
    transition: transform 0.2s;
}

#admin-partner-leaderboard div:hover {
    transform: scale(1.02);
    background: rgba(255, 215, 0, 0.08) !important;
    border-color: var(--gold-main) !important;
}

#admin-partner-leaderboard div:nth-child(1) { 
    border-color: var(--gold-main); 
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1); 
}
/* --- PUBLIC LEADERBOARD DESIGN --- */
.leaderboard-item-public {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: 0.3s;
}

.leaderboard-item-public:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--gold-main);
}

.rank-number-big {
    font-size: 1.5rem;
    font-weight: 900;
    width: 40px;
    color: #444;
}

/* Platz 1: Gold */
.leaderboard-item-public.rank-0 { 
    border-color: #ffd700; 
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent); 
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}
.leaderboard-item-public.rank-0 .rank-number-big { 
    color: #ffd700; 
    text-shadow: 0 0 15px #ffd700; 
}

/* Platz 2: Silber */
.leaderboard-item-public.rank-1 { 
    border-color: #c0c0c0; 
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent); 
}
.leaderboard-item-public.rank-1 .rank-number-big { 
    color: #c0c0c0; 
    text-shadow: 0 0 10px #c0c0c0; 
}

/* Platz 3: Bronze */
.leaderboard-item-public.rank-2 { 
    border-color: #cd7f32; 
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent); 
}
.leaderboard-item-public.rank-2 .rank-number-big { 
    color: #cd7f32; 
    text-shadow: 0 0 10px #cd7f32; 
}

/* Standard Ränge ab Platz 4 */
.leaderboard-item-public {
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
}

.pub-ref-count {
    background: rgba(0,0,0,0.4);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--gold-main);
    border: 1px solid rgba(255,215,0,0.2);
}
/* --- ADMIN BUTTON --- */
.admin-nav-btn {
    display: none; /* shown by JS for admins only */
    align-items: center;
    gap: 5px;
    background: rgba(255, 45, 85, 0.08);
    border: 1px solid rgba(255, 45, 85, 0.3);
    color: #ff6b8a;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-nav-btn:hover {
    background: rgba(255, 45, 85, 0.18);
    border-color: #ff2d55;
    color: #fff;
    transform: translateY(-1px);
}

.admin-icon-pulse {
    display: inline-block;
    font-size: 0.9em;
    transition: transform 0.25s;
}

.admin-nav-btn:hover .admin-icon-pulse {
    transform: rotate(15deg) scale(1.15);
}
/* ═══════════════════════════════════════
   ADMIN PANEL — MOBILE OVERHAUL
   ═══════════════════════════════════════ */

/* Tab nav — always scrollable, hide scrollbar */
#admin-view > div:first-of-type {
    scrollbar-width: none;
}
#admin-view > div:first-of-type::-webkit-scrollbar { display: none; }
#admin-view .chip {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    /* Stats: 2 col on mobile with smaller value font */
    .admin-stat-card { padding: 14px 10px; }
    .admin-stat-value { font-size: 1.35rem; }
    .admin-stat-label { font-size: 0.6rem; }

    /* Admin chat: stack sidebar above chat area */
    #admin-tab-chats.admin-panel-layout {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    /* Users tab: stack to single column */
    #admin-tab-users > div {
        grid-template-columns: 1fr !important;
    }

    /* Table: horizontal scroll */
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-user-table { min-width: 560px; }
    .admin-user-table th, .admin-user-table td { font-size: 0.72rem; padding: 8px 10px; }
    /* Credits table: action buttons stack on tiny screens */
    .credits-table-styled td:last-child > div { flex-direction: column; gap: 4px; }
    .credits-table-styled td:last-child button { min-width: 0 !important; width: 100%; }

    /* Config tab: single col inner grids */
    #admin-tab-config > div { gap: 14px !important; }
    #admin-tab-config .content-box { padding: 16px !important; }
    .cfg-quick-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .admin-config-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
    .cfg-quick-card { padding: 14px !important; }
    .cfg-qa-btn { padding: 10px !important; font-size: 0.8rem !important; }
    #admin-tab-config input[type="text"],
    #admin-tab-config input[type="password"],
    #admin-tab-config textarea,
    #admin-tab-config select { font-size: 0.85rem !important; padding: 10px 12px !important; }
    #admin-tab-config button:not(.cfg-qa-btn) { font-size: 0.82rem !important; padding: 11px 14px !important; }
    #admin-tab-config .config-card { padding: 16px !important; }
    /* Push notification buttons: stack on mobile */
    #admin-tab-config [style*="display:flex"][style*="gap:10px"][style*="flex-wrap:wrap"] {
        flex-direction: column !important;
    }

    /* Invoices table */
    #admin-tab-invoices { overflow-x: auto; }
}