:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --text-white: #ffffff;
    --text-gray: #a1a1aa;
    --danger: #ef4444;
    --success: #22c55e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
}

h1, h2, h3 { font-family: 'Poppins', sans-serif; }
.highlight { color: var(--primary); }

.view { display: none; }
.view.active { display: flex; flex-direction: column; min-height: 100vh; }

/* Login */
#login-view { justify-content: center; align-items: center; }
.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-box h2 { margin-bottom: 30px; font-size: 32px; }
input, select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}
.btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background: var(--primary);
    color: white;
    transition: 0.3s;
}
.btn:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); width: auto; }
.btn-success { background: var(--success); width: auto; }
.error-msg { color: var(--danger); margin-top: 10px; font-size: 14px; }

/* Dashboard Nav */
.admin-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 5%;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(249, 115, 22, 0.2);
}
.admin-nav .logo { font-size: 24px; color: var(--primary); }
.nav-links { display: flex; gap: 10px; }
.tab-btn {
    background: transparent;
    color: var(--text-gray);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); }

/* Dashboard Content */
.admin-content { padding: 40px 5%; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.header-row { display: flex; justify-content: space-between; margin-bottom: 20px; }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { background: rgba(255,255,255,0.02); color: var(--text-gray); font-size: 14px; }
.actions { display: flex; gap: 10px; }
.actions button { padding: 6px 12px; font-size: 12px; }

/* --- MODAL STÍLUSOK --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none; /* Amikor aktív, flex-re váltjuk */
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 450px;
    display: none; /* Amikor aktív, block-ra váltjuk */
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
    margin-bottom: 25px;
    font-size: 22px;
    color: var(--primary);
}

.modal p {
    color: var(--text-gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-actions .btn {
    width: auto;
    padding: 10px 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 14px;
    margin-top: 5px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* --- DRAG & DROP STÍLUSOK --- */
.drag-handle {
    cursor: grab;
    color: var(--text-gray);
    font-size: 20px;
    padding: 15px 10px;
    text-align: center;
    touch-action: none; /* Mobilos görgetés letiltása a fogantyún a húzás érdekében */
}
.drag-handle:active {
    cursor: grabbing;
}
.sortable-ghost {
    opacity: 0.4;
    background-color: rgba(249, 115, 22, 0.1) !important;
}

/* --- MOBIL NÉZET OPTIMALIZÁLÁS --- */
@media screen and (max-width: 768px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-row .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 5%;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }

    th, td {
        padding: 10px;
        font-size: 13px;
    }

    /* Gombok oszlopba rendezése a táblázatban mobilon */
    .actions {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    .actions button {
        width: 100%;
        padding: 10px;
    }
}