/* ===================================================
   MER - MASTER TULAJDONOSI VEZÉRLŐPULT (OWNER PANEL)
   Stíluslap: Modern, Sötét Karbon-Arany/Vörös Prémium UI
   =================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

:root {
    --bg-dark: #0a0b0e;
    --sidebar-bg: #111318;
    --card-bg: #171a22;
    --card-hover: #1e222d;
    --border-color: rgba(255, 255, 255, 0.08);
    --gold: #faa61a;
    --gold-glow: rgba(250, 166, 26, 0.25);
    --primary-color: #c90000;
    --primary-glow: rgba(201, 0, 0, 0.3);
    --discord-blurple: #5865F2;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --danger: #ed4245;
    --success: #3ba55d;
    --warning: #faa61a;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.logo-area {
    padding: 25px 22px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.45rem;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
}
.logo-area .crown-icon {
    color: var(--gold);
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px var(--gold-glow));
}
.logo-area span {
    color: var(--gold);
}

.nav-menu {
    list-style: none;
    padding: 20px 14px;
    flex-grow: 1;
    overflow-y: auto;
}
.nav-menu li {
    margin-bottom: 6px;
}
.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    transition: 0.2s;
    border: 1px solid transparent;
}
.nav-menu a i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 10px;
}
.nav-menu a .badge {
    margin-left: auto;
    background-color: var(--gold);
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}
.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-color: rgba(255,255,255,0.06);
}
.nav-menu a.active {
    background: linear-gradient(90deg, rgba(250, 166, 26, 0.15) 0%, rgba(201, 0, 0, 0.1) 100%);
    color: #fff;
    border: 1px solid rgba(250, 166, 26, 0.35);
    border-left: 4px solid var(--gold);
}
.nav-menu a.active i {
    color: var(--gold);
}

.user-area {
    padding: 18px 20px;
    background-color: #0d0f14;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-area img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}
.user-info .name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}
.user-info .role {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* === MAIN CONTENT === */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(250, 166, 26, 0.04) 0%, transparent 60%),
                radial-gradient(circle at bottom left, rgba(201, 0, 0, 0.03) 0%, transparent 50%),
                var(--bg-dark);
}

.topbar {
    height: 65px;
    background-color: rgba(17, 19, 24, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
}

.owner-pill {
    background: rgba(250, 166, 26, 0.12);
    border: 1px solid rgba(250, 166, 26, 0.3);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.server-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: auto;
}

.view-section {
    padding: 30px;
    max-width: 1500px;
    width: 100%;
}

/* === STAT KÁRTYÁK === */
.stats-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.stat-card.c-gold { border-left: 4px solid var(--gold); }
.stat-card.c-red { border-left: 4px solid var(--primary-color); }
.stat-card.c-blue { border-left: 4px solid var(--discord-blurple); }
.stat-card.c-green { border-left: 4px solid var(--success); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon.i-gold { background: rgba(250, 166, 26, 0.15); color: var(--gold); }
.stat-icon.i-red { background: rgba(201, 0, 0, 0.15); color: var(--primary-color); }
.stat-icon.i-blue { background: rgba(88, 101, 242, 0.15); color: var(--discord-blurple); }
.stat-icon.i-green { background: rgba(59, 165, 93, 0.15); color: var(--success); }

.stat-num {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* === PANELEK & TÁBLÁZATOK === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.panel-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.panel-card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Gombok */
.btn {
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    padding: 10px 18px;
    font-size: 0.9rem;
}
.btn-gold {
    background: linear-gradient(135deg, #faa61a, #d48806);
    color: #000;
    box-shadow: 0 4px 15px rgba(250, 166, 26, 0.3);
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 166, 26, 0.5);
    background: linear-gradient(135deg, #ffb833, #faa61a);
}
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: #e60000;
}
.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #2d8647; }
.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #c03537; }

/* Kapcsoló (Switch) */
.switch-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 15px;
}
.switch-text h4 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
}
.switch-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #2f3136;
    transition: 0.3s;
    border-radius: 28px;
    border: 1px solid var(--border-color);
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(24px); }

/* Táblázatok */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    background: #111318;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #eee;
}
.data-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}
.modal-box {
    background: #171a22;
    border: 1px solid rgba(250, 166, 26, 0.3);
    border-radius: 10px;
    width: 90%;
    max-width: 580px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border-top: 4px solid var(--gold);
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; background: #202225; border: 1px solid var(--border-color); color: #fff; padding: 12px 14px; border-radius: 6px; font-family: inherit; outline: none; box-sizing: border-box; font-size: 0.92rem;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    border-color: var(--gold);
}

/* Üres állapot */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* ===================================================
   MOBIL & TABLET RESZPONZÍV OPTIMALIZÁLÁS (IRL MOBIL)
   =================================================== */

.mobile-nav-toggle {
    display: none;
    background: rgba(250, 166, 26, 0.1);
    border: 1px solid rgba(250, 166, 26, 0.35);
    color: var(--gold);
    font-size: 1.25rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 12px;
}
.mobile-nav-toggle:hover {
    background: rgba(250, 166, 26, 0.2);
}

.sidebar-close-btn {
    display: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.table-responsive table {
    min-width: 600px;
    margin-bottom: 0;
}

@media (max-width: 992px) {
    body {
        display: block !important;
        height: auto !important;
        min-height: 100vh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .mobile-nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        width: 290px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 100000 !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.9) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(320px) !important;
    }

    .sidebar-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: transparent;
        border: none;
        color: #aaa;
        font-size: 1.3rem;
        cursor: pointer;
        padding: 5px;
    }

    .main-content {
        width: 100% !important;
        min-width: 0 !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        height: auto !important;
        display: block !important;
    }

    .topbar {
        padding: 0 15px !important;
        height: 60px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .owner-pill {
        display: none !important;
    }

    .server-status-pill {
        padding: 4px 10px !important;
        font-size: 0.72rem !important;
        margin-left: auto !important;
    }

    .view-section {
        padding: 16px 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .stats-grid-5, 
    .grid-2, 
    .grid-3, 
    .dashboard-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .stat-card {
        padding: 16px !important;
    }

    .modal-box {
        width: 95% !important;
        max-width: 95% !important;
        padding: 20px 15px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 600px) {
    .view-section {
        padding: 12px 10px !important;
    }

    .topbar {
        padding: 0 10px !important;
    }

    .data-table th, .data-table td {
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
    }

    .btn {
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
    }
}
